GRE Tunnel used as a OSPF Virtual-Link


GRE - Generic Routing Encapsulation, is a method of tunneling data from one router to another. Packets of one routing protocol - PASSANGER PROTOCOL are being encapsulated into another routing protocol - TRANSPORT PROTOCOL.

In this example there is a need to establish the connectivity between some OSPF Areas that are not connected to the Area 0, and we do not want to use the Virtual Links.
GRE is a pretty simple concept, you need to configure the following on the BOTH ENDS of the tunnel:

 1. Create a Tunnel Interface and assign the IP Address

    (config)#int tunnel 1
    (config-if)#ip add 172.25.185.3 255.255.255.0

 2. Define the SOURCE and the DESTINATION of the tunnel

   (config-if)#tunnel source 100.10.34.3
   (config-if)#tunnel destination 100.10.34.4

If we are using OSPF then the Tunnel subnet needs to be advertised with the "network" command on both ends of the tunnel.

   (config-router)#network 172.25.185.0 0.0.0.255 area 0

*The IP Address of the Tunnel MUST be advertised into Area 0!!!

You will see that the OSPF Neighbor will be formed on the Tunnel 1 interface.

Cisqueros_R4#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  -        00:00:38    172.25.185.3    Tunnel1 <--- GRE-Neighbor
3.3.3.3           0   FULL/  -        00:00:38    100.10.34.3       Serial1/0.43
5.5.5.5           1   FULL/DR         00:00:38    100.10.45.5       GigabitEthernet5/12

No comments:

Post a Comment

Most Popular Posts