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
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 192.168.0.0 255.255.255.255
Odin(config-if)#int f0/0
Odin(config-if)# ip add 10.0.0.1 255.255.255.252
Thor(config)#int Lo0 Thor(config-if)# ip add 192.168.0.1 255.255.255.255 Thor(config-if)#int f0/1 Thor(config-if)# ip add 10.0.0.2 255.255.255.252 Thor(config-if)#int f0/0 Thor(config-if)# ip add 10.0.0.5 255.255.255.252
Baldur(config)#int Lo0 Baldur(config-if)# ip add 192.168.0.2 255.255.255.255 Baldur(config-if)#int f0/1 Baldur(config-if)# ip add 10.0.0.6 255.255.255.252 Baldur(config-if)#int f0/0 Baldur(config-if)# ip add 10.0.0.9 255.255.255.252
Tyr(config)#int Lo0 Tyr(config-if)# ip add 192.168.0.3 255.255.255.255 Tyr(config-if)#int f0/1 Tyr(config-if)# ip add 10.0.0.10 255.255.255.252
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 0.0.0.0 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 192.168.0.0 0.0.0.0 area 0 Odin(config-router)# net 10.0.0.1 0.0.0.0 area 0
Thor(config)#router ospf 1 Thor(config-router)# net 192.168.0.1 0.0.0.0 area 5 Thor(config-router)# net 10.0.0.2 0.0.0.0 area 0 Thor(config-router)# net 10.0.0.5 0.0.0.0 area 5 Thor(config-router)# net 10.0.0.5 0.0.0.0 area 5
Baldur(config)#router ospf 1 Baldur(config-router)# net 192.168.0.2 0.0.0.0 area 5 Baldur(config-router)# net 10.0.0.6 0.0.0.0 area 5 Baldur(config-router)# net 10.0.0.9 0.0.0.0 area 87
Tyr(config)#router ospf 1 Tyr(config-router)# net 192.168.0.3 0.0.0.0 area 87 Tyr(config-router)# net 10.0.0.10 0.0.0.0 area 87
As you do this, you should notice some statements saying your neighbour came up. On Tyr:
Tyr(config-router)# *Mar 1 00:22:00.371: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.0.2 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 10.0.0.0/30 is subnetted, 1 subnets C 10.0.0.8 is directly connected, FastEthernet0/1 192.168.0.0/32 is subnetted, 1 subnets C 192.168.0.3 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 192.168.0.1
Thor(config-router)#area 5 virtual-link 192.168.0.2
Once you’ve done that you should see this:
*Mar 1 00:34:31.751: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.0.1 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.
Tyr#ping 192.168.0.3 !!!!! 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 (192.168.0.3) (Process ID 1) Router Link States (Area 87) Link ID ADV Router Age Seq# Checksum Link count 192.168.0.2 192.168.0.2 1443 0x80000003 0x009A98 1 192.168.0.3 192.168.0.3 185 0x80000004 0x00931F 2 Net Link States (Area 87) Link ID ADV Router Age Seq# Checksum 10.0.0.9 192.168.0.2 252 0x80000002 0x008F56 Summary Net Link States (Area 87) Link ID ADV Router Age Seq# Checksum 10.0.0.0 192.168.0.2 1424 0x80000001 0x00F0D7 10.0.0.4 192.168.0.2 1444 0x80000001 0x00BE07 192.168.0.0 192.168.0.2 1424 0x80000001 0x00DD87 192.168.0.1 192.168.0.2 1444 0x80000001 0x00C99B 192.168.0.2 192.168.0.2 1444 0x80000001 0x00B5AF
So everything is working nicely. You can see all the Summary LSAs come from 192.168.0.2 (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 192.168.0.1 0 FULL/ - - 10.0.0.5 OSPF_VL0 192.168.0.1 1 FULL/DR 00:00:36 10.0.0.5 FastEthernet0/1 192.168.0.3 1 FULL/BDR 00:00:35 10.0.0.10 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 10.0.0.6/30 1 P2P 1/1 Lo0 1 5 192.168.0.2/32 1 LOOP 0/0 Fa0/1 1 5 10.0.0.6/30 1 BDR 1/1 Fa0/0 1 87 10.0.0.9/30 1 DR 1/1
And that’s it, now you can wack another OSPF area on to a non-zero OSPF area.