diff --git "a/17 \347\275\227\345\251\267/20250421OSFP\345\212\250\346\200\201\350\267\257\347\224\261.md" "b/17 \347\275\227\345\251\267/20250421OSFP\345\212\250\346\200\201\350\267\257\347\224\261.md" deleted file mode 100644 index f50716fbf7e3dc92a79dac68cde9afc0c4168130..0000000000000000000000000000000000000000 --- "a/17 \347\275\227\345\251\267/20250421OSFP\345\212\250\346\200\201\350\267\257\347\224\261.md" +++ /dev/null @@ -1,13 +0,0 @@ -# 笔记 - -1. **RT1#show ip interface brief //查看端口的IP配置情况** -2. 特点: - * 采取分层路由的设计,可划分区域,支持大型互联网环境 - * 允许多开发商的设备集成(开放标准) - * 支持可变长掩码(VLSM)和无类别域间路由(CIDR) - * 没有限制路由的最大跳数 - * 内含3个彼此独立的表: - * ①用于跟踪直连的邻居路由器(邻居关系数据库) - * ②用于确定整个网络的拓扑结构(拓扑数据库) - * ③用作路由选择表 - * 路由更新采用组播报文 \ No newline at end of file diff --git "a/17 \347\275\227\345\251\267/20250421OSPF\345\212\250\346\200\201\350\267\257\347\224\261.md" "b/17 \347\275\227\345\251\267/20250421OSPF\345\212\250\346\200\201\350\267\257\347\224\261.md" new file mode 100644 index 0000000000000000000000000000000000000000..3f2875d11e89b1b7c1a8dfbe7f6ce735eab0203e --- /dev/null +++ "b/17 \347\275\227\345\251\267/20250421OSPF\345\212\250\346\200\201\350\267\257\347\224\261.md" @@ -0,0 +1,283 @@ +# 笔记 + +1. **RT1#show ip interface brief //查看端口的IP配置情况** +2. 特点: + * 采取分层路由的设计,可划分区域,支持大型互联网环境 + * 允许多开发商的设备集成(开放标准) + * 支持可变长掩码(VLSM)和无类别域间路由(CIDR) + * 没有限制路由的最大跳数 + * 内含3个彼此独立的表: + * ①用于跟踪直连的邻居路由器(邻居关系数据库) + * ②用于确定整个网络的拓扑结构(拓扑数据库) + * ③用作路由选择表 + * 路由更新采用组播报文 + +# 作业 + + + +``` +ospf路由器0 +Router> +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter g0/0 +Router(config-if)#ip address 192.168.10.254 255.255.255.0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up + +Router(config-if)#ex +Router(config)#inter g0/1 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +Router(config-if)#ip address 10.10.10.1 255.255.255.0 +Router(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up + +Router(config-if)#ex +Router(config)#router ospf 1 +Router(config-router)#network 10.10.10.0 0.0.0.255 area 0 +Router(config-router)#network 192.168.100 0.0.0.255 area 0 +00:25:54: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.20.1 on GigabitEthernet0/1network 10.10.10.0 0.0.0.255 area 0 +Router(config-router)#network 192.168.10.0 0.0.0.255 area 0 +``` + +``` +路由器2 +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter g0/1 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up + +Router(config-if)#i address 10.10.20.2 255.255.255.0 +% Ambiguous command: "i address 10.10.20.2 255.255.255.0" +Router(config-if)#ip address 10.10.20.2 255.255.255.0 +Router(config-if)#ex +Router(config)#inter g0/0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up + +Router(config-if)#ip address 192.168.20.254 255.255.255.0 +Router(config-if)#ex +Router(config)#inter g0/2 +Router(config-if)#ip address 9.9.9.1 255.255.255.0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ex +Router(config)#^Z +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show ip route +Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area + * - candidate default, U - per-user static route, o - ODR + P - periodic downloaded static route + +Gateway of last resort is not set + + 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks +C 10.10.20.0/24 is directly connected, GigabitEthernet0/1 +L 10.10.20.2/32 is directly connected, GigabitEthernet0/1 + 192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks +C 192.168.20.0/24 is directly connected, GigabitEthernet0/0 +L 192.168.20.254/32 is directly connected, GigabitEthernet0/0 + +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#router ospf 1 +Router(config-router)#network 192.168.20.0 0.0.0.255 area 0 +Router(config-router)#network 10.10.20.0 0.0.0.255 area 0 +Router(config-router)#network 9.9.9.0 0.0.0.255 area 0 +``` + +``` +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter g0/0 +Router(config-if)#ip address 192.168.100.254 255.255.255.0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up + +Router(config-if)#ex +Router(config)#inter g0/1 +Router(config-if)#ip address 10.20.10.1 255.255.255.0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +Router(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up + +Router(config-if)#ex +Router(config)#route rip +Router(config-router)#ver 2 +Router(config-router)#network 10.20.10.0 +Router(config-router)#network 192.168.100.0 +Router(config-router)#ex +Router(config)#inter g0/2 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ip address 11.11.11.2 255.255.255.0 +Router(config-if)#ex +Router(config)#route rip +Router(config-router)#ver 2 + +Router(config-router)#network 11.11.11.0 +​``` + +​``` +RIP路由器 +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter g0/0 +Router(config-if)#ip address 10.30.10.2 255.255.255.0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up + +Router(config-if)#ex +Router(config)#inter g0/1 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up + +Router(config-if)#ip address 10.30.20.1 255.255.255.0 +Router(config-if)#ex +Router(config)#inter g0/2 +Router(config-if)#nos hut + ^ +% Invalid input detected at '^' marker. + +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ip address 12.12.12.1 255.255.255.0 + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#ip route 192.168.200.0 255.255.255.0 10.30.10.1 +Router(config)#ip route 192.168.220.0 255.255.255.0 10.30.20.2 +``` + +``` +路由器3 +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter g0/0 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up + +Router(config-if)#ip address 9.9.9.2 255.255.255.0 +Router(config-if)#ex +Router(config)#inter g0/1 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up + +Router(config-if)#ip address 11.11.11.1 255.255.255.0 +Router(config-if)#ex +Router(config)#inter g0/2 +Router(config-if)#no shut + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ip address 12.12.12.2 255.255.255.0 +Router(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#route rip +Router(config-router)#ver 2 + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#router rip +Router(config-router)#ver 2 +Router(config-router)#net 9.9.9.0 +Router(config-router)#ex +Router(config)#router ospf 1 +Router(config-router)#net 11.11.11.0 0.0.0.255 area 0 +Router(config-router)#ex +Router(config)#router ospf 1 +Router(config-router)#log-ad +Router(config-router)#log-adjacency-changes +Router(config-router)#redis +Router(config-router)#redistribute rip sub +Router(config-router)#redistribute rip subnets +Router(config-router)#red +Router(config-router)#redistribute sta +Router(config-router)#redistribute static sub +Router(config-router)#redistribute static subnets +Router(config-router)#net 9.9.9.0 0.0.0.255 area 0 +Router(config-router)#ex +Router(config)#router r +01:33:52: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.20.254 on GigabitEthernet0/0 from LOADING to FULL, Loadi +Router(config)# +Router(config)#router rip +Router(config-router)#ver 2 +Router(config-router)#red +Router(config-router)#redistribute ospf 1 metric 5 +Router(config-router)#re +Router(config-router)#redistribute sta +Router(config-router)#redistribute static +Router(config-router)#network 11.0.0.0 +``` +