CCNP ROUTE Study – OSPF Virtual Links

By | January 8, 2014

One of the golden rules of OSPF is that all areas must be connected to the backbone area 0, however sometimes this is not physically possible, and this is where Virtual Links come in. A virtual link is created through another area that is connected to area 0.

To explain this, here is our network:

OSPF VIrtual Links

In our network the remote branch router R3 has interfaces in area 23 and area 100, but not area 0. Because area 100 is not connected to the backbone area 0, routes to the branch LAN prefix 10.0.0.0/24 will not be learned by R1.

We can see that R1 has learnt of the Inter Area route to the 192.168.50.0/30 prefix in area 23, but has no knowledge of anything from area 100.

To prove this, let’s look at R1’s routing table:

R1#show ip route  
Codes: 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

Gateway of last resort is not set

     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, FastEthernet0/0
     192.168.50.0/30 is subnetted, 1 subnets
O IA    192.168.50.0 [110/2] via 192.168.20.2, 02:08:32, FastEthernet0/0

To fix this up we create a Virtual Link through area 23 (between R2 and R3) to the backbone area 0 from area 100. Virtual Links are configured referencing the Router ID’s at each end of the link:

R2(config)#router ospf 1
R2(config-router)#area 23 virtual-link 3.3.3.3
R3(config)#router ospf 1
R3(config-router)#area 23 virtual-link 2.2.2.2

Both routers will now indicate that a new link has come up:

R2#
*Mar  1 03:03:24.255: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on OSPF_VL1 from LOADING to FULL, Loading Done

The command show ip ospf virtual-links will also confirm the link is up and that area 23 is being used as the transit area:

R2#show ip ospf virtual-links 
Virtual Link OSPF_VL1 to router 3.3.3.3 is up
  Run as demand circuit
  DoNotAge LSA allowed.
  Transit area 23, via interface FastEthernet0/1, Cost of using 1
  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 2/3, retransmission queue length 0, number of retransmission 1
    First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
    Last retransmission scan length is 1, maximum is 1
    Last retransmission scan time is 0 msec, maximum is 0 msec

So now area 100 has a virtual link to the backbone area, we should see the remote branch LAN prefix in the routing table of R1 as an Inter Area route:

R1#sh ip route              
Codes: 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

Gateway of last resort is not set

     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O IA    10.0.0.0 [110/3] via 192.168.20.2, 00:04:02, FastEthernet0/0
     192.168.50.0/30 is subnetted, 1 subnets
O IA    192.168.50.0 [110/2] via 192.168.20.2, 00:04:02, FastEthernet0/0

I hope this has been a useful explanation.  Thanks for reading, and good luck with your CCNP studies!

Rich

Follow Rich on Twitter

One thought on “CCNP ROUTE Study – OSPF Virtual Links

Leave a Reply

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