Pages

Thursday, January 6, 2011

OSPF Virtual Link

OSPF Virtual Link vs GRE tunnel

In a normal circumstance, all OSPF areas are connected to the backbone area (Area 0). However, in some cases, it is a need to connect an area to non-backbone area. To be able to communicate back to area 0, it is required to have virtual link connecting area 0 to the area.  

Basically, the virtual link is a tunnel interface. Therefore, another way to accomplish the virtual link is to configure the GRE tunnel  carrying the ospf packet over between those 2 areas. Here is the key comparison for configuring 2 types of links.

Virtual-link:
  • It is considered part of (Area 0) by default, without any additional configuration.
  • It dose not require any kind of addressing.
  • Configuration is only needed under the OSPF routing process.
  • Only routing updates are tunneled into the virtual-link, but data traffic is not.
  • Transit area can not be a stub area.
GRE tunnel:
  • Tunnel interfaces must be created and addressing is required. (can be unnumbered).
  • Tunnel Address must be advertised into (Area 0) using a network command.
  • Both routing updates and data traffic are tunneled; this introduces more overhead.
  • Transit area can be any type; this means its your only option if the transit is a stub area.

Ref  :  http://www.networkers-online.com/blog/2008/10/ospf-virtual-links-vs-gre-tunnels/

Below is an example of the disconnected area.



From the diagram above area 10 needs to connect to area 0 via area 25. Virtual links or GRE tunnel is required between them.

Virtual Link configuration

R1
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 area 25 virtual-link 3.3.3.3 (neighbor ID)
 network 10.1.1.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 25

R3
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 area 25 virtual-link 1.1.1.1 (neighbor ID)
 network 172.16.1.0 0.0.0.255 area 10
 network 192.168.1.0 0.0.0.255 area 25


R2 Routing table

Gateway of last resort is not set

     20.0.0.0/24 is subnetted, 1 subnets
O IA    20.20.20.0 [110/4] via 10.1.1.2, 15:35:29, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.1.0 [110/3] via 10.1.1.2, 15:35:29, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
O IA 192.168.1.0/24 [110/2] via 10.1.1.2, 15:41:46, FastEthernet0/0



GRE tunnel configuration

R1 
interface Tunnel0
 ip address 100.100.100.1 255.255.255.0
 ip ospf 1 area 0
 tunnel source FastEthernet0/1
 tunnel destination 192.168.1.2
!
Tunnel will be put in the area 0

router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 10.1.1.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 25

R3

interface Tunnel0
 ip address 100.100.100.2 255.255.255.0
 ip ospf 1 area 0
 tunnel source FastEthernet0/1
 tunnel destination 192.168.1.1
!
Tunnel will be put in the area 0

router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 172.16.1.0 0.0.0.255 area 10
 network 192.168.1.0 0.0.0.255 area 25

Verify tunnel interface 

R3#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            172.16.1.1      YES manual up                    up
FastEthernet0/1            192.168.1.2     YES manual up                    up
Loopback0                  3.3.3.3         YES manual up                    up
Tunnel0                    100.100.100.2   YES manual up                    up

R3#ping 100.100.100.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/48/72 ms


R2 Routing table
Gateway of last resort is not set

     100.0.0.0/24 is subnetted, 1 subnets
O       100.100.100.0 [110/11112] via 10.1.1.2, 00:00:10, FastEthernet0/0
     20.0.0.0/24 is subnetted, 1 subnets
O IA    20.20.20.0 [110/11114] via 10.1.1.2, 00:00:00, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.1.0 [110/11113] via 10.1.1.2, 00:00:00, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
O IA 192.168.1.0/24 [110/2] via 10.1.1.2, 00:09:38, FastEthernet0/0
R2#


No comments:

Post a Comment