OSPF Virtual Links

The idea behind virtual links is fairly straightforward, but the implementation is often confusing.

The OSPF design is structured around a number of design rules which include the fact that all areas must be directly connected to the backbone area (area 0).

Consider the following network:

ospf with tunnels

Here we see area 2 is not directly connected to area 0. Implementing a Virtual Link can resolve this problem. Note that a virtual link is not a tunnel, like a GRE tunnel, but is instead a targeted session that allows two neighbours to become fully adjacent and synchronise their Link State Databases. Consequently, there are no concerns with regard to the impact on MTU. Consider a virtual link as extending area 0 out to the remote area.

Another important consideration is the area through which the Virtual Link traverses must be a regular area, and cannot be any other type of area, such as a stub area. This is referred to as a transit area. In the case of the above network, the transit area would be area 1.

The configuration of a virtual link is also confusing. The syntax is as follows:

area <area-number> virtual-link <router-id>

Note the following:remember

  • The area number is not the area you are trying to connect to the backbone, but instead the area number of the transit area.
  • The router-id is the ID of the OSPF process on the target router, and not necessarily an interface IP. For example in the network above the Router ID is manually configured as 0.0.0.x

So, in the case of the above network, it would make sense to configure two virtual links for redundancy, one between R2 and R4, and one between R3 and R4. The configuration would thus be as follows:

R2(config-router)#area 1 virtual-link 0.0.0.4

R3(config-router)#area 1 virtual-link 0.0.0.4

R4(config-router)#area 1 virtual-link 0.0.0.2
R4(config-router)#area 1 virtual-link 0.0.0.3

Here we can see the Virtual Links configured and up

R2#show ip ospf virtual-links | i up
Virtual Link OSPF_VL0 to router 0.0.0.4 is up
Adjacency State FULL (Hello suppressed)


R3#show ip ospf virtual-links | i up
Virtual Link OSPF_VL0 to router 0.0.0.4 is up
Adjacency State FULL (Hello suppressed)


R4#show ip ospf virtual-links | i up
Virtual Link OSPF_VL1 to router 0.0.0.3 is up
Adjacency State FULL (Hello suppressed)
Virtual Link OSPF_VL0 to router 0.0.0.2 is up
Adjacency State FULL (Hello suppressed)

Note, with the advent of the Virtual Links the loopbacks redistributed in area 0 and 2 are now visible across the OSPF domain:

R1#show ip route ospf | i E2
E1 - OSPF external type 1, E2 - OSPF external type 2
O E2 51.51.51.51 [110/20] via 1.3.1.3, 01:14:09, Gi1/0
O E2 52.52.52.52 [110/20] via 1.3.1.3, 01:14:09, Gi1/0
O E2 53.53.53.53 [110/20] via 1.3.1.3, 01:14:09, Gi1/0


R5#show ip route ospf | i E2
E1 - OSPF external type 1, E2 - OSPF external type 2
O E2 11.11.11.11 [110/20] via 4.5.4.4, 01:13:08, Gi0/0
O E2 12.12.12.12 [110/20] via 4.5.4.4, 01:13:08, Gi0/0
O E2 13.13.13.13 [110/20] via 4.5.4.4, 01:13:08, Gi0/0