目标:
根据下图配置OSPF域,确保实现完全的连通性
配置指南:
? 根据上图配置R1, R2, R3, R4, 和R5的IP地址
? 使用三层到二层的静态映射来配置R4和R5之间的帧中继链路
? 配置R2的Ethernet0/0接口加入area 0
? 配置R2和R3之间的串行链路加入area 0
? 配置R1和R3之间的串行链路加入area 1
? 配置R1和R4之间的以太网链路加入area 1
? 配置R4和R5之间的帧中继链路为点到点网络类型,加入area 2
? 配置R5的Ethernet0/0接口加入area 2
? 配置R3和R4之间的虚拟链路,使用area 1为transit
自我提问:
同前例
最终配置和验证:
R1:
interface Ethernet0/0
ip address 14.0.0.1 255.0.0.0
!
interface Serial0/1
ip address 13.0.0.1 255.0.0.0
!
router ospf 1
network 13.0.0.1 0.0.0.0 area 1
network 14.0.0.1 0.0.0.0 area 1
R2:
interface Ethernet0/0
ip address 2.0.0.2 255.0.0.0
!
interface Serial0/1
ip address 23.0.0.2 255.0.0.0
!
router ospf 1
network 2.0.0.2 0.0.0.0 area 0
network 23.0.0.2 0.0.0.0 area 0
R3:
interface Serial1/2
ip address 13.0.0.3 255.0.0.0
clock rate 64000
!
interface Serial1/3
ip address 23.0.0.3 255.0.0.0
clock rate 64000
!
router ospf 1
area 1 virtual-link 45.0.0.4
network 13.0.0.3 0.0.0.0 area 1
network 23.0.0.3 0.0.0.0 area 0
R4:
interface Ethernet0/0
ip address 14.0.0.4 255.0.0.0
!
interface Serial0/0
ip address 45.0.0.4 255.0.0.0
encapsulation frame-relay
ip ospf network point-to-point
frame-relay map ip 45.0.0.5 405 broadcast
!
router ospf 1
area 1 virtual-link 23.0.0.3
network 14.0.0.4 0.0.0.0 area 1
network 45.0.0.4 0.0.0.0 area 2
R5:
interface Ethernet0/0
ip address 5.0.0.5 255.0.0.0
!
interface Serial0/0
ip address 45.0.0.5 255.0.0.0
encapsulation frame-relay
ip ospf network point-to-point
frame-relay map ip 45.0.0.4 504 broadcast
!
router ospf 1
network 5.0.0.5 0.0.0.0 area 2
network 45.0.0.5 0.0.0.0 area 2
配置虚拟链路之前验证
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
45.0.0.4 1 FULL/DR 00:00:32 14.0.0.4 Ethernet0/0
23.0.0.3 0 FULL/ - 00:00:38 13.0.0.3 Serial0/1
R1#show ip route ospf
O IA 2.0.0.0/8 [110/855] via 13.0.0.3, 00:00:29, Serial0/1
O IA 23.0.0.0/8 [110/845] via 13.0.0.3, 00:00:29, Serial0/1
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
23.0.0.3 0 FULL/ - 00:00:36 23.0.0.3 Serial0/1
R2#show ip route ospf
O IA 13.0.0.0/8 [110/845] via 23.0.0.3, 00:00:59, Serial0/1
O IA 14.0.0.0/8 [110/855] via 23.0.0.3, 00:00:59, Serial0/1
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
23.0.0.2 0 FULL/ - 00:00:36 23.0.0.2 Serial1/3
14.0.0.1 0 FULL/ - 00:00:35 13.0.0.1 Serial1/2
R3#show ip route ospf
O 2.0.0.0/8 [110/791] via 23.0.0.2, 00:01:05, Serial1/3
O 14.0.0.0/8 [110/791] via 13.0.0.1, 00:00:55, Serial1/2
R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
14.0.0.1 1 FULL/BDR 00:00:33 14.0.0.1 Ethernet0/0
45.0.0.5 0 FULL/ - 00:00:34 45.0.0.5 Serial0/0
R4#show ip route ospf
O IA 2.0.0.0/8 [110/865] via 14.0.0.1, 00:00:56, Ethernet0/0
O 5.0.0.0/8 [110/74] via 45.0.0.5, 00:00:56, Serial0/0
O IA 23.0.0.0/8 [110/855] via 14.0.0.1, 00:00:56, Ethernet0/0
O 13.0.0.0/8 [110/74] via 14.0.0.1, 00:00:56, Ethernet0/0
R5#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
45.0.0.4 0 FULL/ - 00:00:32 45.0.0.4 Serial0/0
R5#show ip route ospf
配置虚拟链路之后验证
R1#show ip route ospf
O IA 2.0.0.0/8 [110/855] via 13.0.0.3, 00:00:06, Serial0/1
O IA 5.0.0.0/8 [110/84] via 14.0.0.4, 00:00:15, Ethernet0/0
O IA 23.0.0.0/8 [110/845] via 13.0.0.3, 00:00:06, Serial0/1
O IA 45.0.0.0/8 [110/74] via 14.0.0.4, 00:00:15, Ethernet0/0
R2#show ip route ospf
O IA 5.0.0.0/8 [110/929] via 23.0.0.3, 00:00:18, Serial0/1
O IA 13.0.0.0/8 [110/845] via 23.0.0.3, 00:00:18, Serial0/1
O IA 14.0.0.0/8 [110/855] via 23.0.0.3, 00:00:18, Serial0/1
O IA 45.0.0.0/8 [110/919] via 23.0.0.3, 00:00:18, Serial0/1
R3#show ip route ospf
O 2.0.0.0/8 [110/791] via 23.0.0.2, 00:00:23, Serial1/3
O IA 5.0.0.0/8 [110/865] via 13.0.0.1, 00:00:23, Serial1/2
O 14.0.0.0/8 [110/791] via 13.0.0.1, 00:00:33, Serial1/2
O IA 45.0.0.0/8 [110/855] via 13.0.0.1, 00:00:23, Serial1/2
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
45.0.0.4 0 FULL/ - - 14.0.0.4 OSPF_VL1
23.0.0.2 0 FULL/ - 00:00:38 23.0.0.2 Serial1/3
14.0.0.1 0 FULL/ - 00:00:37 13.0.0.1 Serial1/2
R3#show ip ospf virtual-links
Virtual Link OSPF_VL1 to router 45.0.0.4 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface Serial1/2, Cost of using 791
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:00
Adjacency State FULL (Hello suppressed)
Index 2/3, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 1, maximum is 1
Last retransmission scan time is 0 msec, maximum is 0 msec
R4#show ip route ospf
O 2.0.0.0/8 [110/865] via 14.0.0.1, 00:00:16, Ethernet0/0
O 5.0.0.0/8 [110/74] via 45.0.0.5, 00:00:36, Serial0/0
O 23.0.0.0/8 [110/855] via 14.0.0.1, 00:00:16, Ethernet0/0
O 13.0.0.0/8 [110/74] via 14.0.0.1, 00:00:36, Ethernet0/0
R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
23.0.0.3 0 FULL/ - - 13.0.0.3 OSPF_VL1
14.0.0.1 1 FULL/BDR 00:00:32 14.0.0.1 Ethernet0/0
45.0.0.5 0 FULL/ - 00:00:33 45.0.0.5 Serial0/0
R4#show ip ospf virtual-links
Virtual Link OSPF_VL1 to router 23.0.0.3 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface Ethernet0/0, Cost of using 74
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:09
Adjacency State FULL (Hello suppressed)
Index 1/2, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
R5#show ip route ospf
O IA 2.0.0.0/8 [110/929] via 45.0.0.4, 00:00:21, Serial0/0
O IA 23.0.0.0/8 [110/919] via 45.0.0.4, 00:00:21, Serial0/0
O IA 13.0.0.0/8 [110/138] via 45.0.0.4, 00:00:40, Serial0/0
O IA 14.0.0.0/8 [110/74] via 45.0.0.4, 00:00:40, Serial0/0
注解:
为了确保SPF的正确计算,area 0就作为其他区域的参考点,也就意味着其他区域都必须和骨干区域邻接。前面例子讲述了虚拟链路对非连续area 0的修复,这个例子则讲述虚拟链路对非连续区域连接至area 0。
没有配置虚拟链路之前可以看到show ip route的输出是不被同步的,之后就形成了全网的连接性。