OSPF Virtual Link

Multi Area OSPF: Backbone Area

In a blog post about Multi Area OSPF we went over some pros of having multiple OSPF areas in your network.

These include:

  • Reduce the size of the routing tables. Each OSPF area can contain multiple Routers and cover a portion of a network that can be summarized.
  • Reduce traffic between different parts of a network
  • Reduce execution of Shortest Path First algorithm

As we all know OSPF network requires the use of a Backbone Area (Area 0). All other areas must connect to a backbone area and packets that travel between the areas must go through at least one backbone router.

Potential problems with OSPF Network Design

OSPF requires that areas be contiguous and that each non-backbone area connect to the backbone area.

However, sometimes it may not be possible to have contiguos backbone area.

We might need to add a new area in a place where it won't have a connection to existing backbone area. Also a situation can happen where we need to merge two existing OSPF networks, with each OSPF network having it's own backbone area.

How do we fix these problems without the need for network redesign? Luckily, there's a solution: Virtual Link.

NOTE: Virtual Link is not meant as a permanent solution. Virtual Link can provide a quick fix of existing design problems, but you should NOT design your network with Virtual Links in mind.

Virtual Link?

Virtual Link is basically a link that enables two Area Border Routers that connect to the same area to form a neighborship as if they're connected directly.

So, that means two routers can form a neighborship through another OSPF area, even if they're separated by many other routers.

If effect that makes backbone area contiguous.

Once the routers form a neighborship they can exchange LSAs over the virtual link. The difference in router communication is that OSPF messages are sent as unicasts.

Configuration example

Now, let's make a network topology like the one in the image and configure a virtual link between ABR1 and ABR2.

First, we'll need to configure interface addresses and get OSPF running. As with the last post about OSPF Stubby Area Types I'll just show you the relevant parts of the Routers' configuration.

Let's make a recap of network and Interface addresses used:

  • ABR1 - R4 both connected to 192.168.1.0/24
  • ABR2 - R5 both connected to 10.1.1.0/24

The networks between other routers:

  • ABR1 - R2 -> 172.16.1.0/30
  • R2 - ABR2 -> 172.16.2.0/30

OK, now we have all relevant information and let's configure Interface addresses and do a basic OSPF configuration.

Interface addresses & basic OSPF configuration

Let's do R4 and R5 because they are the simplest. Here's R4:

interface FastEthernet0/0
 ip address 192.168.1.25 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 192.168.1.0 0.0.0.255 area 0
!

Configuration of R5:

interface FastEthernet0/0
 ip address 10.1.1.45 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 10.1.1.0 0.0.0.255 area 0
!

Pretty simple, huh? Now, let's do ABR1:

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 ip ospf 1 area 0
!
interface FastEthernet2/0
 ip address 172.16.1.1 255.255.255.252
 ip ospf 1 area 1
!

ABR1 and R4 should have neighborship. Now let's do R2:

interface FastEthernet0/0
 ip address 172.16.2.1 255.255.255.252
!
interface FastEthernet1/0
 ip address 172.16.1.2 255.255.255.252
!
router ospf 20
 log-adjacency-changes
 network 172.16.1.0 0.0.0.3 area 1
 network 172.16.2.0 0.0.0.3 area 1

Neighborship between R2 and ABR1 will come up. Let's configure ABR2:

interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.1.1.1 255.255.255.0
 ip ospf 2 area 0
!
interface FastEthernet1/0
 ip address 172.16.2.2 255.255.255.252
 ip ospf 2 area 1
!

That's it! Our network is configured. Or so it would seem. As we said before, OSPF requires a contiguous backbone area.

Let's see the effect of having a discountigous backbone area. Take a look at the routing table of Router R4:

R4#sh ip route
 
!! LEGEND OMITTED !!!!!!!!!!!!!!!
 
Gateway of last resort is not set
 
     172.16.0.0/30 is subnetted, 2 subnets
O IA    172.16.1.0 [110/2] via 192.168.1.1, 00:26:42, FastEthernet0/0
O IA    172.16.2.0 [110/3] via 192.168.1.1, 00:11:18, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0

See? R4 doesn't even know about the 10.1.1.0/24 network, because it's located inside another backbone area.

Let's remedy that. We'll make a Virtual Link between ABRs.

Configure Virtual Link between ABR1 & ABR2

It's basically very easy to configure Virtual Link. On each Area Border Router we need to specify the Router-Id of other ABR Router and Area through which the Virtual Link passes.

On ABR1 we need to specify Router ID of ABR2 - 2.2.2.2 (from Loopback Interface) and Area 1 and on ABR2 we need to use ABR1's Router ID (1.1.1.1) and Area 1.

It's simple. Let's configure it on ABR1:

ABR1(config)#router ospf 1
ABR1(config-router)#area 1 virtual-link ?
  A.B.C.D  ID (IP addr) associated with virtual link neighbor
 
ABR1(config-router)#area 1 virtual-link 2.2.2.2
ABR1(config-router)#

Let's configure it on ABR2. NOTE: when you open console on ABR2 you might get the message:

*Mar  1 00:24:23.743: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 172.16.1.1, FastEthernet1/0

That message means the Router receieved an OSPF packet with Area ID 0 on an interface that has another area configured, such as Area 1.

This is true, because when we configure Virtual Link on ABR1 it sends OSPF packets with Area ID 0 to ABR2 and ABR2 receives those packets on Interface configured with Area 1.

The message states: must be virtual-link but not found, so we should configure it:

ABR2(config)#router ospf 2
ABR2(config-router)#area 1 virtual 1.1.1.1
ABR2(config-router)#

Once you configure the Virtual Link, you should see the following message:

*Mar  1 00:25:40.507: %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on OSPF_VL0 from LOADING to FULL, Loading Done

This means the neighborship is established between ABR1 and ABR2. FULL state means Routers have identical Link State Databases, which means all Routers in both parts of backbone area know how to get to networks in the other part. Let's take a look at R4 and R5's routing table:

R4#show ip route
 
!! LEGEND OMITTED !!!!!!!!!!!!!!!
 
Gateway of last resort is not set
 
     172.16.0.0/30 is subnetted, 2 subnets
O IA    172.16.1.0 [110/2] via 192.168.1.1, 00:31:29, FastEthernet0/0
O IA    172.16.2.0 [110/3] via 192.168.1.1, 00:31:29, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O       10.1.1.0 [110/4] via 192.168.1.1, 00:31:29, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0

Now for R5:

R5#sh ip route ospf
     172.16.0.0/30 is subnetted, 2 subnets
O IA    172.16.1.0 [110/3] via 10.1.1.1, 00:31:04, FastEthernet0/0
O IA    172.16.2.0 [110/2] via 10.1.1.1, 00:31:04, FastEthernet0/0
O    192.168.1.0/24 [110/4] via 10.1.1.1, 00:31:04, FastEthernet0/0

That's it. Backbone area is now contiguous and OSPF works as it should.

Summary

In this post we explored some potential problems with OSPF networks and found a potential solution to those problems:

In some cases it's not physically possible to have all areas connected to a backbone area, or due to design issues we have two parts of a backbone area.

In those cases we can use Virtual Link to connect two parts of backbone area through non-backbone area or to connect a non-backbone area to backbone area through another non-backbone area.

Thank you for visiting and until next time I wish you happy networking.

Comments are closed