试验目的:讨论ospf中如果有重复的router-id是否能建立邻居。
试验拓扑:
R2#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
33.0.0.0/32 is subnetted, 1 subnets
O 33.33.33.33 [110/65] via 10.1.2.2, 00:00:09, Serial1/1
22.0.0.0/24 is subnetted, 1 subnets
C 22.22.22.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial1/1
C 10.1.1.0 is directly connected, Serial1/0
R2#show ip os nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 0 FULL/ - 00:00:35 10.1.2.2 Serial1/1
1.1.1.1 0 FULL/ - 00:00:38 10.1.1.1 Serial1/0
从R2的路由表中可以看出R1,R3的router-id都为1.1.1.1的情况下,邻居都是能建立的,他只能学到一边的路由,在R1和R3上也只能学到R2的路由,都学不到router-id相同的路由。然而重启ospf的进程后,R2的路由表变成了:
R2#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
22.0.0.0/24 is subnetted, 1 subnets
C 22.22.22.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial1/1
C 10.1.1.0 is directly connected, Serial1/0
11.0.0.0/32 is subnetted, 1 subnets
O 11.11.11.11 [110/65] via 10.1.1.1, 00:00:01, Serial1/0
由此说明:他装入路由表的时候具有随机性,也就是说在同一时间下,那边的邻居先起来就把那边的邻居路由装入路由表。
R1#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
22.0.0.0/32 is subnetted, 1 subnets
O 22.22.22.22 [110/65] via 10.1.1.2, 00:02:29, Serial1/1
10.0.0.0/24 is subnetted, 2 subnets
O 10.1.2.0 [110/128] via 10.1.1.2, 00:02:29, Serial1/1
C 10.1.1.0 is directly connected, Serial1/1
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
R3#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
33.0.0.0/24 is subnetted, 1 subnets
C 33.33.33.0 is directly connected, Loopback0
22.0.0.0/32 is subnetted, 1 subnets
O 22.22.22.22 [110/65] via 10.1.2.1, 00:02:48, Serial1/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial1/0
O 10.1.1.0 [110/128] via 10.1.2.1, 00:02:48, Serial1/0
试验拓扑二:
R2#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
33.0.0.0/32 is subnetted, 1 subnets
O 33.33.33.33 [110/65] via 10.1.2.2, 00:00:58, Serial1/1
22.0.0.0/24 is subnetted, 1 subnets
C 22.22.22.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial1/1
C 10.1.1.0 is directly connected, Serial1/0
11.0.0.0/32 is subnetted, 1 subnets
O 11.11.11.11 [110/65] via 10.1.1.1, 00:01:36, Serial1/0
R2#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 0 FULL/ - 00:00:31 10.1.1.1 Serial1/0
1.1.1.1 0 FULL/ - 00:00:30 10.1.2.2 Serial1/1
R3#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
33.0.0.0/24 is subnetted, 1 subnets
C 33.33.33.0 is directly connected, Loopback0
22.0.0.0/32 is subnetted, 1 subnets
O IA 22.22.22.22 [110/65] via 10.1.2.1, 00:01:08, Serial1/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Serial1/0
O IA 10.1.1.0 [110/128] via 10.1.2.1, 00:01:08, Serial1/0
11.0.0.0/32 is subnetted, 1 subnets
O IA 11.11.11.11 [110/129] via 10.1.2.1, 00:01:08, Serial1/0
R1#show ip route
Codes: 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
i - IS-IS, su - IS-IS summary, 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
33.0.0.0/32 is subnetted, 1 subnets
O IA 33.33.33.33 [110/129] via 10.1.1.2, 00:01:10, Serial1/1
22.0.0.0/32 is subnetted, 1 subnets
O 22.22.22.22 [110/65] via 10.1.1.2, 00:01:47, Serial1/1
10.0.0.0/24 is subnetted, 2 subnets
O IA 10.1.2.0 [110/128] via 10.1.1.2, 00:01:47, Serial1/1
C 10.1.1.0 is directly connected, Serial1/1
11.0.0.0/24 is subnetted, 1 subnets
C 11.11.11.0 is directly connected, Loopback1
从这里可以看出,三台路由器的路由表达到了同步,说明router-id是一个区域的概念,他同时也是一个路由器的标示。只要在不同区域,router-id相同是没有关系的,但是在同一个区域的情况下就会出现路由只能学到一边的情况。
本文转自 gehailong 51CTO博客,原文链接:http://blog.51cto.com/gehailong/297380,如需转载请自行联系原作者