搭建实验环境:
1)公司网络扩容,新区域与骨干区域无法相连
2)通过配置虚链路解决问题
实现此案例需要按照如下步骤进行。
interface GigabitEthernet0/0/0
ip address 192.168.14.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.12.1 255.255.255.0
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.14.0 0.0.0.255
area 0.0.0.1
network 192.168.12.0 0.0.0.255
vlink-peer 2.2.2.2
interface GigabitEthernet0/0/0
ip address 192.168.23.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.12.2 255.255.255.0
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 192.168.12.0 0.0.0.255
vlink-peer 1.1.1.1
area 0.0.0.2
network 192.168.23.0 0.0.0.255
interface GigabitEthernet0/0/0
ip address 192.168.23.3 255.255.255.0
ospf 1 router-id 3.3.3.3
area 0.0.0.2
network 192.168.23.0 0.0.0.255
interface GigabitEthernet0/0/0
ip address 192.168.14.4 255.255.255.0
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 192.168.14.0 0.0.0.255
<R1>dis ip ro
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.12.0/24 Direct 0 0 D 192.168.12.1 GigabitEthernet
0/0/1
192.168.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.14.0/24 Direct 0 0 D 192.168.14.1 GigabitEthernet
0/0/0
192.168.14.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.14.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.23.0/24 OSPF 10 2 D 192.168.12.2 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
<R1>dis ospf ro
OSPF Process 1 with Router ID 1.1.1.1
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.12.0/24 1 Transit 192.168.12.1 1.1.1.1 0.0.0.1
192.168.14.0/24 1 Transit 192.168.14.1 1.1.1.1 0.0.0.0
192.168.23.0/24 2 Inter-area 192.168.12.2 2.2.2.2 0.0.0.1
Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0
<R2>dis ospf ro
OSPF Process 1 with Router ID 2.2.2.2
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.12.0/24 1 Transit 192.168.12.2 2.2.2.2 0.0.0.1
192.168.23.0/24 1 Transit 192.168.23.2 2.2.2.2 0.0.0.2
192.168.14.0/24 2 Transit 192.168.12.1 1.1.1.1 0.0.0.1
Total Nets: 3
Intra Area: 3 Inter Area: 0 ASE: 0 NSSA: 0
<R3>dis ospf ro
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.23.0/24 1 Transit 192.168.23.3 3.3.3.3 0.0.0.2
192.168.12.0/24 2 Inter-area 192.168.23.2 2.2.2.2 0.0.0.2
192.168.14.0/24 3 Inter-area 192.168.23.2 2.2.2.2 0.0.0.2
Total Nets: 3
Intra Area: 1 Inter Area: 2 ASE: 0 NSSA: 0
<R4>dis ospf ro
OSPF Process 1 with Router ID 4.4.4.4
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.14.0/24 1 Transit 192.168.14.4 4.4.4.4 0.0.0.0
192.168.12.0/24 2 Inter-area 192.168.14.1 1.1.1.1 0.0.0.0
192.168.23.0/24 3 Inter-area 192.168.14.1 2.2.2.2 0.0.0.0
Total Nets: 3
Intra Area: 1 Inter Area: 2 ASE: 0 NSSA: 0
<R1>dis ospf vlink
OSPF Process 1 with Router ID 1.1.1.1
Virtual Links
Virtual-link Neighbor-id -> 2.2.2.2, Neighbor-State: Full
Interface: 192.168.12.1 (GigabitEthernet0/0/1)
Cost: 1 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal
<R2>dis ospf vlink
OSPF Process 1 with Router ID 2.2.2.2
Virtual Links
Virtual-link Neighbor-id -> 1.1.1.1, Neighbor-State: Full
Interface: 192.168.12.2 (GigabitEthernet0/0/1)
Cost: 1 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal