OSPF與靜態(tài)路由分布配置 如上例圖所示:“RIP與OSPF路由重分布例子” switchA(config)#router ospf switchA(config-router)#network 192.168.10.0 0.0.0.255 area 0 switchA(config-router)#network 192.168.20.0 0.0.0.255 area 0 switchA(config-router)#network 192.168.1.0 0.0.0.255 area 0 switchA(config-router)#exit switchA(config)#end router(config)#router ospf router(config-router)#network 192.168.1.0 0.0.0.255 area 0 router(config-router)#network 192.168.2.0 0.0.0.255 area 0 router(config-router)#exit router(config)#ip route 192.168.30.0 255.255.255.0 192.168.2.1 router(config)#ip route 192.168.40.0 255.255.255.0 192.168.2.1 router(config)#end switchB(config)#ip route 192.168.10.0 255.255.255.0 192.168.2.2 switchB(config)#ip route 192.168.20.0 255.255.255.0 192.168.2.2 switchB(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 switchB(config)#end 在互連路由器上進(jìn)行重分布配置,使其兩個(gè)不同路由協(xié)議的網(wǎng)絡(luò)進(jìn)行互通 Router(config)#router ospf Router(config-router)#redistribute static subnets//將OSPF重分布到靜態(tài)路由 Router(config-router)#exit Router(config)#end 此例我只是做了把OSPF重分布到靜態(tài)路由,是因?yàn)殪o態(tài)路由本身就是一個(gè)明確的鄰接路由,因?yàn)槲覀冊?/span>switchB上已經(jīng)明確指定靜態(tài)路由了,所以就沒有做相關(guān)的重分布配置,話說過來,網(wǎng)絡(luò)設(shè)備也沒有提供相就的靜態(tài)路由重分布的方法。 配置好后:三臺(tái)設(shè)備的路由表情況如下: Router: Router#show ip route Codes: C - connected, S - static, R - RIP B - BGP 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 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set C 192.168.1.0/24 is directly connected, FastEthernet 0/0 C 192.168.1.2/32 is local host. C 192.168.2.0/24 is directly connected, FastEthernet 0/1 C 192.168.2.2/32 is local host. O 192.168.10.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0 O 192.168.20.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0 S 192.168.30.0/24 [1/0] via 192.168.2.1 S 192.168.40.0/24 [1/0] via 192.168.2.1 switchA: switchA#show ip route Codes: C - connected, S - static, R - RIP B - BGP 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 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set C 192.168.1.0/24 is directly connected, FastEthernet 0/1 C 192.168.1.1/32 is local host. C 192.168.10.0/24 is directly connected, VLAN 10 C 192.168.10.1/32 is local host. C 192.168.20.0/24 is directly connected, VLAN 20 C 192.168.20.1/32 is local host. O 192.168.30.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0 O 192.168.40.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0 O 192.168.2.0/24 [110/2] via 192.168.1.2, 1d,22:44:08, FastEthernet 0/0 switchB: switchB#show ip route Codes: C - connected, S - static, R - RIP B - BGP 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 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set C 192.168.2.0/24 is directly connected, FastEthernet 0/1 C 192.168.2.1/32 is local host. S 192.168.10.0/24 [1/0] via 192.168.2.2 S 192.168.20.0/24 [1/0] via 192.168.2.2 S 192.168.1.0/24 [1/0] via 192.168.2.2 C 192.168.40.0/24 is directly connected, VLAN 20 C 192.168.40.1/32 is local host. 根據(jù)上述的路由表的分析我們得知OSPF與static的路由重分布成功。 |
聯(lián)系客服