OSPF 开放式最短路径优先 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

拓扑图:

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

配置OSPF

r1(config)#router ospf 1
r1(config-router)# network <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />10.0.0.0 0.255.255.255 area 1
r1(config-router)# network 192.168.10.0 0.0.0.255 area 1
r1(config-router)# network 192.168.60.0 0.0.0.255 area 1

 

r2(config)#router ospf 1
r2(config-router)# network 192.168.10.0 0.0.0.255 area 1
r2(config-router)# network 192.168.20.0 0.0.0.255 area 1

 

r3(config)#router ospf 1
r3(config-router)# network 192.168.20.0 0.0.0.255 area 1
r3(config-router)# network 192.168.30.0 0.0.0.255 area 1

 

r4(config)#router ospf 1
r4(config-router)# network 192.168.50.0 0.0.0.255 area 1
r4(config-router)# network 192.168.60.0 0.0.0.255 area 1

 

r5(config)#router ospf 1
r5(config-router)# network 192.168.40.0 0.0.0.255 area 1
r5(config-router)# network 192.168.50.0 0.0.0.255 area 1

 

r6(config)#router ospf 1
r6(config-router)# network 172.168.0.0 0.0.255.255 area 1
r6(config-router)# network 192.168.30.0 0.0.0.255 area 1
r6(config-router)# network 192.168.40.0 0.0.0.255 area 1

 

 

 

 

 

 

验证OSPF协议

r1#show ip route
C    10.0.0.0/8 is directly connected, FastEthernet0/0
O    172.168.0.0/16 [110/193] via 192.168.60.2, 00:07:24, Serial0/1
                    [110/193] via 192.168.10.2, 00:07:24, Serial0/0
C    192.168.10.0/24 is directly connected, Serial0/0
O    192.168.20.0/24 [110/128] via 192.168.10.2, 00:07:24, Serial0/0
O    192.168.30.0/24 [110/192] via 192.168.10.2, 00:07:24, Serial0/0
O    192.168.40.0/24 [110/192] via 192.168.60.2, 00:07:24, Serial0/1
O    192.168.50.0/24 [110/128] via 192.168.60.2, 00:07:24, Serial0/1
C    192.168.60.0/24 is directly connected, Serial0/1

 

r2#show ip route
O    10.0.0.0/8 [110/65] via 192.168.10.1, 00:09:43, Serial0/0
O    172.168.0.0/16 [110/129] via 192.168.20.2, 00:09:33, Serial0/1
C    192.168.10.0/24 is directly connected, Serial0/0
C    192.168.20.0/24 is directly connected, Serial0/1
O    192.168.30.0/24 [110/128] via 192.168.20.2, 00:09:33, Serial0/1
O    192.168.40.0/24 [110/192] via 192.168.20.2, 00:09:33, Serial0/1
O    192.168.50.0/24 [110/192] via 192.168.10.1, 00:09:33, Serial0/0
O    192.168.60.0/24 [110/128] via 192.168.10.1, 00:09:43, Serial0/0

 

r3#show ip route
O    10.0.0.0/8 [110/129] via 192.168.20.1, 00:10:09, Serial0/0
O    172.168.0.0/16 [110/65] via 192.168.30.2, 00:10:09, Serial0/1
O    192.168.10.0/24 [110/128] via 192.168.20.1, 00:10:09, Serial0/0
C    192.168.20.0/24 is directly connected, Serial0/0
C    192.168.30.0/24 is directly connected, Serial0/1
O    192.168.40.0/24 [110/128] via 192.168.30.2, 00:10:09, Serial0/1
O    192.168.50.0/24 [110/192] via 192.168.30.2, 00:09:59, Serial0/1
O    192.168.60.0/24 [110/192] via 192.168.20.1, 00:10:09, Serial0/0

 

r4#show ip route
O    10.0.0.0/8 [110/65] via 192.168.60.1, 00:10:40, Serial0/0
O    172.168.0.0/16 [110/129] via 192.168.50.1, 00:10:40, Serial0/1
O    192.168.10.0/24 [110/128] via 192.168.60.1, 00:10:40, Serial0/0
O    192.168.20.0/24 [110/192] via 192.168.60.1, 00:10:40, Serial0/0
O    192.168.30.0/24 [110/192] via 192.168.50.1, 00:10:40, Serial0/1
O    192.168.40.0/24 [110/128] via 192.168.50.1, 00:10:40, Serial0/1
C    192.168.50.0/24 is directly connected, Serial0/1
C    192.168.60.0/24 is directly connected, Serial0/0

 

 

 

 

r5#show ip route
O    10.0.0.0/8 [110/129] via 192.168.50.1, 00:11:02, Serial0/0
O    172.168.0.0/16 [110/65] via 192.168.40.2, 00:11:02, Serial0/1
O    192.168.10.0/24 [110/192] via 192.168.50.1, 00:11:02, Serial0/0
O    192.168.20.0/24 [110/192] via 192.168.40.2, 00:11:02, Serial0/1
O    192.168.30.0/24 [110/128] via 192.168.40.2, 00:11:02, Serial0/1
C    192.168.40.0/24 is directly connected, Serial0/1
C    192.168.50.0/24 is directly connected, Serial0/0
O    192.168.60.0/24 [110/128] via 192.168.50.1, 00:11:02, Serial0/0

 

r6#show ip route
O    10.0.0.0/8 [110/193] via 192.168.40.1, 00:11:12, Serial0/0
                [110/193] via 192.168.30.1, 00:11:12, Serial0/1
C    172.168.0.0/16 is directly connected, FastEthernet0/0
O    192.168.10.0/24 [110/192] via 192.168.30.1, 00:11:12, Serial0/1
O    192.168.20.0/24 [110/128] via 192.168.30.1, 00:11:22, Serial0/1
C    192.168.30.0/24 is directly connected, Serial0/1
C    192.168.40.0/24 is directly connected, Serial0/0
O    192.168.50.0/24 [110/128] via 192.168.40.1, 00:11:22, Serial0/0
O    192.168.60.0/24 [110/192] via 192.168.40.1, 00:11:12, Serial0/0