#

Monday, December 18, 2017

Configuring GRE Tunnels

It's a method of tunneling data from one router to another router. The sending router encapsulates packets of one networking protocol called the passenger protocol inside packets of another protocol called the transport protocol (ex:- IPv6 inside IPv4). It is not necessarily be two protocols. It can also be used to hide topology information inside a network within same protocol. Also note that GRE tunnel is not an encrypted tunnel.

Here is an example configuration I have done.


















Assume that R1's L1:10.10.10.1/24 (interface Loopback 1) is a connected external network to R1 & R4's L1:40.40.40.4/24 (interface Loopback 1) is a connected external network to R4..
Here I am going to tunnel the traffic between those 2 networks..

Configuration of GRE is like the following..

Create the tunnel interface on R1..
R1(config)#interface Tunnel14
R1(config-if)#ip address 14.14.14.1 255.255.255.0
R1(config-if)#tunnel source 1.1.1.1
R1(config-if)#tunnel destination 4.4.4.4

Create the tunnel interface on R4..
R4(config)#interface Tunnel41
R4(config-if)#ip address 14.14.14.4 255.255.255.0
R4(config-if)#tunnel source 4.4.4.4
R4(config-if)#tunnel destination 1.1.1.1

Loopback 0 interfaces of R1 were taken as tunnel sources and destinations for high availability. Those 2 interfaces must be reachable via under lay routing. I used EIGRP on all interface on all routers except the tunnel interfaces. Also both the tunnel interfaces must be in the same subnet.

Setting static routes to destinations on both R1 & R4..

R1(config)#ip route 40.40.40.0 255.255.255.0 14.14.14.4

R4(config)#ip route 10.10.10.0 255.255.255.0 14.14.14.1

Now the configuration is done. Routing tables of R1 & R4 will be like the following..
























Pings & Traceroute outputs will look like the following..








Because the tunnel interface seems like a connected interface, you can configure some other routing protocol like OSPF inside tunnel and bring up adjacency if needed.

Note:- 

Default mode of a tunnel interface is GRE. you can change it to some other like ip-in-ip by using the command tunnel mode ipip in tunnel interface.

No comments:

Post a Comment