Cisco OSPF Virtual Link Example

Reading Time: 3 minutes

In my chase for CCNP I came across virtual links while studying for the CCNP ROUTE exam. When I first read through the concept I was slightly lost during the description. However, upon a couple of runs through a lab it became clear on how easy the were. Before I list the condensed two step (or focus points if you will) to look at let’s look at what a virtual link is and why we would use it.

The world of OSPF is built around a very rigid set of rules. These rules determine where an ABR can exist, where an ASBR can exist, even where external routes can and cannot enter utilizing LSA’s. perhaps the most stringent of rules is the rule about areas. Remember, all areas must connect to area 0. A main reason for these areas is to segment the network into manageable sections, provide small routing tables from summarization of these areas, and ultimately prevent OSPF from recalculating a large number of routes speeding up convergence of route failure.

The question now becomes. What is the virtual link. Basically, it is a bandaid to make routing functional until you, as a network engineer, get a chance to properly reconfigure the network. A virtual link lets you, in a sense, tunnel one area through another transparent to the transit area in order to “trick” area 0 and the “rule breaking” area into thinking they are directly connected and therefore following the rules. With it being a bandaid, breaking the rules, and requiring some network trickery, when would we use this? There are a few primary instances I would like to point out.

First, in your own network suppose a router in area 0 connecting two other area 0 routers (in turn connected to other areas) goes down. The end result is a discontinuous area 0. It ends up looking like this.

{area 4} — {area 0} — {area 3} — {area 0} — {area 2}

In this case you could create a virtual link between area 0 through area 3 until you could repair the fallen router. This similar looking scenario could also be the acquisition of another company running OSPF where the discontinuous area 0 isn’t due to a failure, but due to another existing OSPF routing domain joining yours.

In another case, time and cost could be a factor forcing you to quickly bring up a new section of the network with the best option in regards to the situation being to add another area off of an existing non backbone area. An example would look like the following.

{area 4} — {area 0} — {area 3} — {area 2}

In this situation we could build a virtual link connecting area 2 through area 3 to the backbone area 0. However, it is important to remember that the solution of a virtual link should not be left in production for very long. Instead the network should be reconfigured to repair the issue as soon as possible.

This brings up the how to of this article. As mentoined above, there are really two easy things to remember when creating a virtual link.

1.) Focus only on the transit area. This is the area that is “in the way” of the disconnected area that you want to reach area 0. In the case of the sample below this area is area 1.

2.) Learn the neighbors OSPF Router I.D.s

With those two thoughts in mind the task is fairly simple. Connect to the router joining area 0 with the “in the way” area. Under the OSPF configuration you type 1 simple command with the two thoughts above in mind.

area # virtual-link router-id

Where # is the number of the transit (in the way) area. Router-id is the OSPF I.D. of the router on the other side. See the example below for reference.

That is it. It is really that simple.
Virtual-Link-Example

R1

interface Loopback1
 ip address 192.168.200.1 255.255.255.0
!
interface Serial0/0
 ip address 192.168.100.1 255.255.255.252
!
router ospf 42
 router-id 1.1.1.1
 log-adjacency-changes
 network 192.168.100.0 0.0.0.3 area 0
 network 192.168.200.0 0.0.0.255 area 0
R2

interface Serial0/0
 ip address 192.168.100.2 255.255.255.252
!
interface Serial0/1
 ip address 172.20.100.1 255.255.255.252
!
router ospf 42
 router-id 2.2.2.2
 log-adjacency-changes
 area 1 virtual-link 3.3.3.3
 network 172.20.100.0 0.0.0.3 area 1
 network 192.168.100.0 0.0.0.3 area 0
R3

interface Serial0/0
 ip address 10.10.100.1 255.255.255.252
!
interface Serial0/1
 ip address 172.20.100.2 255.255.255.252
!
router ospf 42
 router-id 3.3.3.3
 log-adjacency-changes
 area 1 virtual-link 2.2.2.2
 network 10.10.100.0 0.0.0.3 area 2
 network 172.20.100.0 0.0.0.3 area 1
R4

interface Loopback1
 ip address 10.10.200.1 255.255.255.0
!
interface Serial0/0
 ip address 10.10.100.2 255.255.255.252
!
router ospf 42
 router-id 4.4.4.4
 log-adjacency-changes
 network 10.10.100.0 0.0.0.3 area 2
 network 10.10.200.0 0.0.0.255 area 2
Share this article:

Permanent link to this article: https://www.packetpilot.com/cisco-ospf-virtual-link-example/

Leave a Reply

Your email address will not be published.