OSPF Virtual Link example

From IPFlow Netflow Collector

OSPF with virtual-link Example

This is a simple example of OSPF with a Virtual Link on Cisco routers (using Dynamips and GNS3).

Author: Christophe Fillot - 19-Nov-2007


Table of contents

Topology

Image:OSPF_VL_topo.png


IOS configurations

  • R0 (http://www.ipflow.utc.fr/configs/OSPF_VirtualLink/R0.cfg)
  • R1 (http://www.ipflow.utc.fr/configs/OSPF_VirtualLink/R1.cfg)
  • R2 (http://www.ipflow.utc.fr/configs/OSPF_VirtualLink/R2.cfg)
  • R3 (http://www.ipflow.utc.fr/configs/OSPF_VirtualLink/R3.cfg)


Dynamips/Dynagen/GNS3 configuration

You can use this configuration file (http://www.ipflow.utc.fr/configs/OSPF_VirtualLink/ospf_virtual_link.net) directly with Dynagen or GNS3. Change the working directory and Cisco IOS image path to match your needs.


Description

In OSPF, all areas must be connected to the backbone area (area 0). Generally, this is done with a physical connection. When this is not possible, a Virtual Link must be used.


In this scenario, we have 3 areas:

  • R0 and R1 are in area 7 ;
  • R1 and R2 are in area 5 ;
  • R2 and R3 are in area 0.


We can see that area 7 is not connected to area 0. To solve this, we establish an OSPF virtual link between R1 (which is an ABR for area 7) and R2 (which is an ABR for area 0). The virtual link must be established in both directions.


The R1 configuration is as follows:

router ospf 100
 log-adjacency-changes
 area 5 virtual-link 10.10.0.2
 network 20.20.0.0 0.0.255.255 area 5
 network 30.30.0.0 0.0.255.255 area 7
!


The R2 configuration is as follows:

router ospf 100
 log-adjacency-changes
 area 5 virtual-link 20.20.0.1
 network 10.10.0.0 0.0.255.255 area 0
 network 20.20.0.0 0.0.255.255 area 5
!


We specify in the configuration that we go through area 5 (transit area).


Then, R1 and R2 establish an adjacency through the virtual link:

R1#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.10.0.2         0   FULL/  -           -        20.20.1.1       OSPF_VL0
10.10.0.2         1   FULL/BDR        00:00:33    20.20.1.1       FastEthernet1/0
30.30.0.0         1   FULL/DR         00:00:33    30.30.1.1       FastEthernet0/0


R2#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.10.0.3         1   FULL/DR         00:00:34    10.10.1.2       FastEthernet0/0
20.20.0.1         0   FULL/  -           -        20.20.1.2       OSPF_VL0
20.20.0.1         1   FULL/DR         00:00:34    20.20.1.2       FastEthernet1/0


Now R1 is a member of area 0:

R1#sh ip ospf database 

            OSPF Router with ID (20.20.0.1) (Process ID 100)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.10.0.2       10.10.0.2       1     (DNA) 0x80000003 0x00F950 3
10.10.0.3       10.10.0.3       16    (DNA) 0x80000002 0x003875 2
20.20.0.1       20.20.0.1       1468        0x80000002 0x00514A 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.1.2       10.10.0.3       16    (DNA) 0x80000001 0x006E73

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
20.20.0.1       10.10.0.2       11    (DNA) 0x80000001 0x00E615
20.20.0.1       20.20.0.1       1478        0x80000001 0x0038B1
20.20.1.0       10.10.0.2       55    (DNA) 0x80000001 0x00C936
20.20.1.0       20.20.0.1       1478        0x80000001 0x0025C7
30.30.0.0       20.20.0.1       1478        0x80000001 0x005184
30.30.1.0       20.20.0.1       1478        0x80000001 0x002AAE

                Router Link States (Area 5)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.10.0.2       10.10.0.2       1470        0x80000003 0x006446 1
20.20.0.1       20.20.0.1       1469        0x80000004 0x009FA8 2

                Net Link States (Area 5)

Link ID         ADV Router      Age         Seq#       Checksum
20.20.1.2       20.20.0.1       1483        0x80000001 0x005752

                Summary Net Link States (Area 5)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.0.2       10.10.0.2       1524        0x80000001 0x00CD42
10.10.0.3       10.10.0.2       1480        0x80000001 0x00CD40
10.10.1.0       10.10.0.2       1524        0x80000001 0x00C44F
30.30.0.0       20.20.0.1       1479        0x80000001 0x005184
30.30.1.0       20.20.0.1       1479        0x80000001 0x002AAE

                Router Link States (Area 7)
          
Link ID         ADV Router      Age         Seq#       Checksum Link count
20.20.0.1       20.20.0.1       1479        0x80000003 0x00441C 1
30.30.0.0       30.30.0.0       1485        0x80000002 0x00BA35 2

                Net Link States (Area 7)

Link ID         ADV Router      Age         Seq#       Checksum
30.30.1.1       30.30.0.0       1485        0x80000001 0x002736

                Summary Net Link States (Area 7)

Link ID         ADV Router      Age         Seq#       Checksum
10.10.0.2       20.20.0.1       1465        0x80000001 0x0033C8
10.10.0.3       20.20.0.1       1465        0x80000001 0x0033C6
10.10.1.0       20.20.0.1       1465        0x80000001 0x002AD5
20.20.0.1       20.20.0.1       1480        0x80000001 0x0038B1
20.20.1.0       20.20.0.1       1480        0x80000001 0x0025C7

Note: DNA means "DoNotAge".