Virtual links are used to extend Area 0 across another area. They also can be thought of as tunnels for LSAs. They are deployed in cases when areas become partitioned or an area does not border Area 0. To configure a virtual link, use the following router command:
Router(config-route)#area “transit_area_id” virtual-link “router_id_of_remote”
The area_id is the “transit area” that OSPF will tunnel through. The “transit area” cannot be a stub area of any kind. At the end of the tunnel will be another router terminating the virtual link; use the router ID of that router in the router_id field. Virtual links use RIDs, and they are another reason why we use fixed RIDs when configuring OSPF. Remember that a virtual link is actually an extension of Area 0. Think of the virtual link as the router’s new interface into Area 0. Configure all interface options on the virtual link.
As depicted in the diagram , we have 3 areas connected in series – Area 0 , Area 1 and Area 2.
Now Lets see , how many routes R1 learns from its OSPF neighbor R2 –As we see, no Inter area (OIA) route is being learnt by R1 . The reason – OSPF rule book says , a non-backbone area cannot learn OSPF routes from another non backbone area , which means R1 (in Area 2) cannot learn OSPF routes of Area 1 (which again is another non-backbone area) directly.
And as expected , no routes learned by R3 for networks in Area 2
Now , how do we correct this situation and have OSPF to have R1 to learn routes from Area 1 and Area 0.
The solution is Virtual Link – We need to extend the Bacbone (Area 0 ) via virtual link upto ABR Router R2.Note – Virtual link is a logical link using the least cost path between the ABR of the non-backbone connected area and the backbone ABR of the transit area.
Finally , its time to see whether R1 (Area 2) receives all the routes post confuguration of virtual link between R2 and R3 (ABRs on transit Area 1).
The Routers now have the complete routing table.
Another scenario where we need to implement virtual link –