cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
2567
Views
0
Helpful
4
Replies

GRE Tunnel traffic

bapatsubodh
Level 1
Level 1

Hi,

When we configfure the GRE tunnel with source as any interface or ip address of that interface

all the traffic the is bound for that interface undergoes the GRE header  encapsulation and at the end of the tunnel it gets decapsulated.

What happens when source is loopback interface? Which traffic will be encapsulated?

Or in  this case, in  order to encapsulate the traffic  we should use a static route command and route the interesting traffic into the tunnel.


What happens if a routing protocol is running on the GRE tunnel and if we learn some routes form this protocol. A packet destined for the routes those are learned from protocol running on the GRE where it gets encapsulated?

Please share the experience.

Thanks

Subodh

1 Accepted Solution

Accepted Solutions

Jerry Ye
Cisco Employee
Cisco Employee

What happens when source is loopback interface? Which traffic will be encapsulated?

Yes, any traffic going through the GRE tunnel will be encapsulated.

Or in  this case, in  order to encapsulate the traffic  we should use a static route command and route the interesting traffic into the tunnel.

Doesn't matter, you can run static route or dynamic routing protocol (peering with the interface IP address of the tunnel).

What happens if a routing protocol is running on the GRE tunnel and if we learn some routes form this protocol. A packet destined for the routes those are learned from protocol running on the GRE where it gets encapsulated?

Yes, any traffic going through the GRE tunnel will be encapsulated.

HTH,

jerr

View solution in original post

4 Replies 4

Jerry Ye
Cisco Employee
Cisco Employee

What happens when source is loopback interface? Which traffic will be encapsulated?

Yes, any traffic going through the GRE tunnel will be encapsulated.

Or in  this case, in  order to encapsulate the traffic  we should use a static route command and route the interesting traffic into the tunnel.

Doesn't matter, you can run static route or dynamic routing protocol (peering with the interface IP address of the tunnel).

What happens if a routing protocol is running on the GRE tunnel and if we learn some routes form this protocol. A packet destined for the routes those are learned from protocol running on the GRE where it gets encapsulated?

Yes, any traffic going through the GRE tunnel will be encapsulated.

HTH,

jerr

Hi,

If I understand it correctly :

If tunnel ip at source is : 10.1.1.1 /24

and tunnel destination IP is : 10.1.1.2 /24

tunnel is up and I am abot to ping 10.1.1.2 from 10.1.1.2 as source IP. ( could be loopback or interfce ip address )

Ip route 172.16.2.0 /24 10.1.1.2  This will push packets destinated for 172.16.2.0/ 24 into tunnel that will undergo GRE encapsulation.

Thanks

subodh

Okay, here is how it works:

R1                       R2

T0 <---------------> T0

L1 <-- Tunnel --> L2

S1 <--  WAN  --> S2

The tunnel between R1 and R2 are peering from their loopback interfaces. IP address are 1.1.1.1 and 2.2.2.2.

Assuming R1 and get to R2's loopback via the WAN S1 and R2 can reach to R1's loopback via WAN S2.

The tunnel will have IP address 10.1.1.1/30 on R1 and 10.1.1.2/30 on R2.

When you ping from R1's loopback 1.1.1.1 to R2's loopback 2.2.2.2, the traffic will not be encapsulated.

When you ping from R1's tunnel IP 10.1.1.1 to R2's tunnel IP 10.1.1.2, the traffic will be encapsulated.

HTH,

jerry

Richard Burts
Hall of Fame
Hall of Fame

Subodh

I am a little uncertain what you mean to say when you say:"all the traffic the is bound for that interface undergoes the GRE header  encapsulation". Which interface do you mean by "that interface"? Is it the "source" interface or is it the tunnel interface?

It is not correct to say that any traffic going for the source interface will be encapsulated by GRE. It is correct to say that any traffic going for the tunnel interface will be encapsulated by GRE.

If we understand that point then it becomes clear that it does not matter whether the source interface is a physical interface or is a loopback interface. It is traffic that is trying to go through the tunnel that gets encapsulated.

And with that understanding it also becomes clear that it does not matter whether we have configured static routes to send traffic through the tunnel or have configured dynamic routing protocols which will routes traffic through the tunnel. Any traffic being sent through the tunnel gets encapsulated by GRE. And any traffic going for the source interface (but not going through the tunnel) does not get encapsulated.

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: