Showing results for 
Search instead for 
Did you mean: 

How to configure a GRE tunnel





Tunneling provides a mechanism to transport packets of one protocol within another protocol. The protocol that is carried is called as the passenger protocol, and the protocol that is used for carrying the passenger protocol is called as the transport protocol. Generic Routing Encapsulation (GRE) is one of the available tunneling mechanisms which uses IP as the transport protocol and can be used for carrying many different passenger protocols. The tunnels behave as virtual point-to-point links that have two endpoints identified by the tunnel source and tunnel destination addresses at each endpoint.


The below diagram shows encapsulation process of GRE packet as it traversers the router and enters the tunnel interface:



Configuring GRE Tunnel:


Configuring a GRE tunnel involves creating a tunnel interface, which is a logical interface. Then you must configure the tunnel endpoints for the tunnel interface.


To configure the tunnel source and destination, issue the tunnel source {ip-address | interface-type} and tunnel destination {host-name | ip-address} commands under the interface configuration mode for the tunnel.


The below example explain about how to create simple GRE tunnels between endpoints and the necessary steps to create and verify the GRE tunnel between the two networks.R1's and R2's Internal subnets( and are  communicating with each other using GRE tunnel over internet.Both Tunnel interfaces are part of the network.




First step is to create our tunnel interface on R1 and R2 :



R1(config)# interface Tunnel1

R1(config-if)# ip address

R1(config-if)# ip mtu 1400

R1(config-if)# ip tcp adjust-mss 1360

R1(config-if)# tunnel source

R1(config-if)# tunnel destination

R2(config)# interface Tunnel1

R2(config-if)# ip address

R2(config-if)# ip mtu 1400

R2(config-if)# ip tcp adjust-mss 1360

R2(config-if)# tunnel source

R2(config-if)# tunnel destination


Since GRE is an encapsulating protocol, we adjust the maximum transfer unit (mtu) to 1400 bytes and maximum segment size (mss) to 1360 bytes. Because most transport MTUs are 1500 bytes and we have an added overhead because of GRE, we must reduce the MTU to account for the extra overhead. A setting of 1400 is a common practice and will ensure unnecessary packet fragmentation is kept to a minimum.


After configuring tunnel,two tunnel endpoints can see each other can verify using an icmp echo from one end.

R1# ping

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:


Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms


Workstations on either network will still not be able to reach the other side unless a routing is configure on each router.Here We will configure static route on both router.


R1(config)# ip route

R2(config)# ip route


Now both networks ( and are able to freely communicate with each other over the GRE Tunnel .


Generic Routing Encapsulation (GRE)

Community Member

good explanation

Community Member

Great guide. If you're using Linux, there's also a Guide for Setting up a GRE Tunnel on a Cisco Router using Ubuntu AWS Client.

Community Member

Is GRE supported on N5548?  I am investigating possibility of setting up GRE between Cisco 4948-10GE and Nexus N5548.  If these is not possible, can you suggest any alternative options?


I have an issue that enpdoints are able to reach each other only when i enter routes as:

R1: ip route int tunnel1

R2: ip route int tunnel1

Have anyone idea why doesn’t it works when i enter route by next hop address?

P.S. also i saw this type of routes on working enterprise routers that had been configured not by me

P.P.S all the test routers have only initial config of GRE by this article

Sorry for bad English


this what i have under my config for.

Ip classless

ip route GigabitEthernet0/0/0

ip route


both routers can ping them safe but can not ping one and the other  !!!


Hi, I have an issue with my gre . The tunnel is up and there is reachability on the end points but goes down once I introduce keep alives configs. What could be the cause?


Thanks in advance,



Hi, I have an issue with my GRE . The tunnel is up and there is reachability on the end points but goes down once I introduce keep alives configs. What could be the cause?


Thanks in advance,



The tunnel interface need to be on the same network?