In OSPF (Open Shortest Path First) for IPv4, a virtual link is a mechanism used to connect areas that are not directly adjacent within an OSPF Autonomous System (AS). This is particularly useful when a non-backbone area is separated from the backbone area by another non-backbone area. The virtual link serves as a logical link, allowing routers in the non-backbone area to communicate with the backbone area through the transit area. The configuration of an OSPF IPv4 virtual link involves specifying the router IDs of the routers at both ends of the virtual link and ensuring a consistent OSPF area ID. Virtual links play a crucial role in maintaining OSPF network connectivity and ensuring a continuous and optimal routing path, especially in scenarios where a direct physical connection between areas is not feasible.
Disclaimer
This Configuration Guide is designed to assist members to enhance their skills in particular technology area. While every effort has been made to ensure that all material is as complete and accurate as possible, the enclosed material is presented on an Dzas isdz basis. Neither the authors nor Forum assume any liability or responsibility to any person or entity with respect to loss or damages incurred from the information contained in this guide. This configuration guide was developed by Forum. Any similarities between material presented in this configuration guide and any other material is completely coincidental.
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.2(4)M1, DEVELOPMENT TEST SOFTWARE
Task 1: Configure OSPF Virtual Link
Step 1: In the configuration mode of router configure IPv4 OSPF Process for Virtual Link by following command:
R1:
router ospf 1
network 12.0.0.1 0.0.0.0 area 0
network 11.0.1.1 0.0.0.0 area 0
network 11.0.2.1 0.0.0.0 area 0
network 11.0.3.1 0.0.0.0 area 0
exit
R2:
router ospf 2
network 12.0.0.2 0.0.0.0 area 0
network 23.0.0.2 0.0.0.0 area 1
network 22.0.1.2 0.0.0.0 area 1
network 22.0.2.2 0.0.0.0 area 1
network 22.0.3.2 0.0.0.0 area 1
exit
R3:
router ospf 3
network 23.0.0.3 0.0.0.0 area 1
network 33.0.1.3 0.0.0.0 area 1
network 33.0.2.3 0.0.0.0 area 1
network 33.0.3.3 0.0.0.0 area 1
network 34.0.0.3 0.0.0.0 area 2
exit
R4:
router ospf 4
network 34.0.0.4 0.0.0.0 area 2
network 44.0.1.4 0.0.0.0 area 2
network 44.0.2.4 0.0.0.0 area 2
network 44.0.3.4 0.0.0.0 area 2
exit
R4#show ip route
Codes: L - local, 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, + - replicated route
Gateway of last resort is not set
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 34.0.0.0/24 is directly connected, Serial2/0
L 34.0.0.4/32 is directly connected, Serial2/0
44.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 44.0.1.0/24 is directly connected, Loopback1
L 44.0.1.4/32 is directly connected, Loopback1
C 44.0.2.0/24 is directly connected, Loopback2
L 44.0.2.4/32 is directly connected, Loopback2
C 44.0.3.0/24 is directly connected, Loopback3
L 44.0.3.4/32 is directly connected, Loopback3
Step 2: Configure OSPF Virtual Link
R2:
router ospf 2
area 1 virtual-link 33.0.3.3
exit
R3:
router ospf 3
area 1 virtual-link 22.0.3.2
exit
Task 2: Verification:
Step 1: Verify virtual link in OSPF process
R3#show ip ospf virtual-link
Virtual Link OSPF_VL0 to router 22.0.3.2 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface FastEthernet0/0
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
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:07
Adjacency State FULL (Hello suppressed)
Index 1/3, 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
Step: 2 Verify routes on R1 & R4 router’s routing table R2 receives external routes E2 through Not so Stubby Area (NSSA) and marked as N2
R1#show ip route
Codes: L - local, 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, + - replicated route
Gateway of last resort is not set
11.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 11.0.1.0/24 is directly connected, Loopback1
L 11.0.1.1/32 is directly connected, Loopback1
C 11.0.2.0/24 is directly connected, Loopback2
L 11.0.2.1/32 is directly connected, Loopback2
C 11.0.3.0/24 is directly connected, Loopback3
L 11.0.3.1/32 is directly connected, Loopback3
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.0.0.0/24 is directly connected, Serial1/0
L 12.0.0.1/32 is directly connected, Serial1/0
22.0.0.0/32 is subnetted, 3 subnets
O IA 22.0.1.2 [110/65] via 12.0.0.2, 00:26:23, Serial1/0
O IA 22.0.2.2 [110/65] via 12.0.0.2, 00:26:13, Serial1/0
O IA 22.0.3.2 [110/65] via 12.0.0.2, 00:26:05, Serial1/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.0.0.0 [110/65] via 12.0.0.2, 00:26:36, Serial1/0
33.0.0.0/32 is subnetted, 3 subnets
O IA 33.0.1.3 [110/66] via 12.0.0.2, 00:12:36, Serial1/0
O IA 33.0.2.3 [110/66] via 12.0.0.2, 00:12:36, Serial1/0
O IA 33.0.3.3 [110/66] via 12.0.0.2, 00:12:36, Serial1/0
34.0.0.0/24 is subnetted, 1 subnets
O IA 34.0.0.0 [110/129] via 12.0.0.2, 00:12:36, Serial1/0
44.0.0.0/32 is subnetted, 3 subnets
O IA 44.0.1.4 [110/130] via 12.0.0.2, 00:12:36, Serial1/0
O IA 44.0.2.4 [110/130] via 12.0.0.2, 00:12:37, Serial1/0
O IA 44.0.3.4 [110/130] via 12.0.0.2, 00:12:37, Serial1/0
R4#show ip route
Codes: L - local, 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, + - replicated route
Gateway of last resort is not set
11.0.0.0/32 is subnetted, 3 subnets
O IA 11.0.1.1 [110/130] via 34.0.0.3, 00:14:14, Serial1/0
O IA 11.0.2.1 [110/130] via 34.0.0.3, 00:14:14, Serial1/0
O IA 11.0.3.1 [110/130] via 34.0.0.3, 00:14:15, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.0.0.0 [110/129] via 34.0.0.3, 00:14:14, Serial1/0
22.0.0.0/32 is subnetted, 3 subnets
O IA 22.0.1.2 [110/66] via 34.0.0.3, 00:14:19, Serial1/0
O IA 22.0.2.2 [110/66] via 34.0.0.3, 00:14:19, Serial1/0
O IA 22.0.3.2 [110/66] via 34.0.0.3, 00:14:19, Serial1/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.0.0.0 [110/65] via 34.0.0.3, 00:14:19, Serial1/0
33.0.0.0/32 is subnetted, 3 subnets
O IA 33.0.1.3 [110/65] via 34.0.0.3, 00:14:21, Serial1/0
O IA 33.0.2.3 [110/65] via 34.0.0.3, 00:14:21, Serial1/0
O IA 33.0.3.3 [110/65] via 34.0.0.3, 00:14:21, Serial1/0
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 34.0.0.0/24 is directly connected, Serial1/0
L 34.0.0.4/32 is directly connected, Serial1/0
44.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 44.0.1.0/24 is directly connected, Loopback1
L 44.0.1.4/32 is directly connected, Loopback1
C 44.0.2.0/24 is directly connected, Loopback2
L 44.0.2.4/32 is directly connected, Loopback2
C 44.0.3.0/24 is directly connected, Loopback3
L 44.0.3.4/32 is directly connected, Loopback3
R4#ping 22.0.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 22.0.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 604/695/736 ms
Area 2 can communicate with Area 1 without connecting through Backbone area 0 with the help of Virtual Link