From Scratch #4: Configuring an OSPF Virtual Link

Today we are going to configure an OSPF Virtual Link.

What is it?

Before we answer what it is, take a step back and look at one of the basic requirements of OSPF. That is, all areas must be connected to the backbone area (area 0). A virtual link gives us a way around that requirement.

If for some reason, you are stuck with a topology where you must connect a non-zero area via another non-zero area you can create a virtual link between the ABR in non-connected area to a router in area 0. That will hopefully make a bit more sense in a few minutes.

Basic OSPF Setup

Basic Topology


This is our basic topology in GNS3. 4 Routers in a row, Thor is an ABR for area 0 and 5 and Baldur will try and be an ABR for area 5 and area 87. The IP address under the router name is the Loopback0 address.

Step 1 – IP addresses

First, we’ll give them all IP addresses. Seeing as this is a “from scratch” exercise I’ll actually show this, by feel free to skip through to step 2.

Odin(config)#int Lo0
Odin(config-if)# ip add
Odin(config-if)#int f0/0
Odin(config-if)# ip add
Thor(config)#int Lo0
Thor(config-if)# ip add
Thor(config-if)#int f0/1
Thor(config-if)# ip add
Thor(config-if)#int f0/0
Thor(config-if)# ip add
Baldur(config)#int Lo0
Baldur(config-if)# ip add
Baldur(config-if)#int f0/1
Baldur(config-if)# ip add
Baldur(config-if)#int f0/0
Baldur(config-if)# ip add
Tyr(config)#int Lo0
Tyr(config-if)# ip add
Tyr(config-if)#int f0/1
Tyr(config-if)# ip add

You should see some prompts saying your Loopbacks are up and running, but not much else.

Step 2 – Configuring Basic OSPF

Next step is also pretty straight forward. We enable a OSPF routing process and start OSPF running on the interfaces. I’m using a mask for all my network statements. I’ve chosen to put the loopback0 interfaces on Thor and Baldur in area 5.

Odin(config-if)#router ospf 1
Odin(config-router)# net area 0
Odin(config-router)# net area 0
Thor(config)#router ospf 1
Thor(config-router)# net area 5
Thor(config-router)# net area 0
Thor(config-router)# net area 5
Thor(config-router)# net area 5
Baldur(config)#router ospf 1
Baldur(config-router)# net area 5
Baldur(config-router)# net area 5
Baldur(config-router)# net area 87
Tyr(config)#router ospf 1
Tyr(config-router)# net area 87
Tyr(config-router)# net area 87

As you do this, you should notice some statements saying your neighbour came up. On Tyr:

*Mar 1 00:22:00.371: %OSPF-5-ADJCHG: Process 1, Nbr on FastEthernet0/1 from LOADING to FULL, Loading Done

So everything looks like it’s working nicely. But if you do a show ip route on any of the routers, you will notice that some routes are missing – on Tyr there are no routes except it’s own locally connected routes:

Tyr#show ip route is subnetted, 1 subnets
C is directly connected, FastEthernet0/1 is subnetted, 1 subnets
C is directly connected, Loopback0

Similarly, on the others Tyr’s networks aren’t in the routing table.

Which is what we expected. Type 3 Summary LSAs can only go between a non-zero area and area 0, not between two non-zero areas.

Step 3 – Configuring the Virtual Link

Configuring the virtual link is very simple. It must be configured on the two ABRs. One that is trying to connect two non-zero areas and one that is connected to area 0. In our case, Baldur and Thor. The virtual link must point to the router ID of the far end router. Note that the two ABRs do not have (and would not usually be) directly connected. I simply chose to have a direct link between them to cut down on clutter in the topology – but the virtual link would work fine with several hops between the ABRs.

Baldur(config-router)#area 5 virtual-link
Thor(config-router)#area 5 virtual-link

Once you’ve done that you should see this:

*Mar 1 00:34:31.751: %OSPF-5-ADJCHG: Process 1, Nbr on OSPF_VL0 from LOADING to FULL, Loading Done

Testing and Confirmation

Test is easy. Jump on Tyr, see if we can ping Odin and check the routing table/OSPF database.

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
Tyr#show ip ospf data
            OSPF Router with ID ( (Process ID 1)
                Router Link States (Area 87)
Link ID         ADV Router      Age         Seq#       Checksum Link count     1443        0x80000003 0x009A98 1     185         0x80000004 0x00931F 2
                Net Link States (Area 87)
Link ID         ADV Router      Age         Seq#       Checksum     252         0x80000002 0x008F56
                Summary Net Link States (Area 87)
Link ID         ADV Router      Age         Seq#       Checksum     1424        0x80000001 0x00F0D7     1444        0x80000001 0x00BE07     1424        0x80000001 0x00DD87     1444        0x80000001 0x00C99B     1444        0x80000001 0x00B5AF

So everything is working nicely. You can see all the Summary LSAs come from (Baldur). Baldur is now the ABR between area 0 and area 87.

It is also worth doing a quick show ip ospf neighbor on the ABRs.

Baldur#show ip ospf neigh
Neighbor ID Pri State Dead Time Address Interface 0 FULL/ - - OSPF_VL0 1 FULL/DR 00:00:36 FastEthernet0/1 1 FULL/BDR 00:00:35 FastEthernet0/0

You can see the neighborship has come up on interface OSPF_VL0.

The virtual link is also added as a ospf interface.

Baldur#show ip ospf int brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
VL0 1 0 1 P2P 1/1
Lo0 1 5 1 LOOP 0/0
Fa0/1 1 5 1 BDR 1/1
Fa0/0 1 87 1 DR 1/1

And that’s it, now you can wack another OSPF area on to a non-zero OSPF area.


This entry was posted in Config, From Scratch, IOS, OSPF by Tom. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *