How to Configure GRE Tunnel in Cisco

GRE means Generic Routing Encapsulation. GRE is a Cisco proprietary standard for encapsulating layer 3 packets over an IP network.GRE tunnel Create  a Virtual Point to Point Connection. GRE Protocol offer many Advantage like-use Multiple Protocol in single Backbone,Being less resource demanding than its alternatives (e.g. IPsec VPN)

Please note that GRE does not encrypt the tunnel but encapsulates it with a GRE header.

if data protection require need to configure IPSEC.

in this Topology we Configure GRE Tunnel.

 

R1 Router Initial Configure

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e0/1
R1(config-if)#no sh
R1(config-if)#ip add
R1(config-if)#ip address
*Apr 2 12:06:23.975: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Apr 2 12:06:24.975: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to up
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#ip os
R1(config-if)#ip ospf 10 ar
R1(config-if)#ip ospf 10 area 0
R1(config-if)#int e0/0
R1(config-if)#no sh
R1(config-if)#no shutdow
R1(config-if)#ip add
R1(config-if)#ip address 192.
*Apr 2 12:07:00.435: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Apr 2 12:07:01.439: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
R1(config-if)#ip address 192.168.4.1 255.255.255.0
R1(config-if)#
*Apr 2 12:07:46.719: %OSPF-5-ADJCHG: Process 10, Nbr 192.168.1.2 on Ethernet0/1 from LOADING to FULL, Loading Done

R2 Router Initial Configure

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int e0/0
R2(config-if)#no sh
R2(config-if)#ip add
R2(config-if)#ip address 19
*Apr 2 12:08:36.591: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Apr 2 12:08:37.595: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#ip os
R2(config-if)#ip ospf 10 ar
R2(config-if)#ip ospf 10 area 0
R2(config-if)#
R2(config-if)#
R2(config-if)#
R2(config-if)#do ping 192.168.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R2(config-if)#
*Apr 2 12:09:30.047: %OSPF-5-ADJCHG: Process 10, Nbr 192.168.1.2 on Ethernet0/0 from LOADING to FULL, Loading Done

R3 Initial Configure

R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int e0/0
R3(config-if)#no sh
R3(config-if)#
*Apr 2 12:07:24.967: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Apr 2 12:07:25.967: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
R3(config-if)#ip add
R3(config-if)#ip address 192.168.1.2 255.255.255.0
R3(config-if)#ip os
R3(config-if)#ip ospf 10 ar
R3(config-if)#ip ospf 10 area 0
R3(config-if)#
*Apr 2 12:07:46.767: %OSPF-5-ADJCHG: Process 10, Nbr 192.168.1.1 on Ethernet0/0 from LOADING to FULL, Loading Done
R3(config-if)#int e0/1
R3(config-if)#no sh
R3(config-if)#
*Apr 2 12:08:03.419: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Apr 2 12:08:04.419: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to up
R3(config-if)#ip add
R3(config-if)#ip address 192.168.2.2 255.255.255.0
R3(config-if)#ip ospf 10 area 0
R3(config-if)#
*Apr 2 12:09:30.035: %OSPF-5-ADJCHG: Process 10, Nbr 192.168.2.1 on Ethernet0/1 from LOADING to FULL, Loading Done
R3(config-if)#

Now We Configure GRE in R1 and R2

R1(config)#interface tunnel 0
R1(config-if)#ip add
R1(config-if)#ip address 10.10.10.1 255.255.255.0
R1(config-if)#ip mt
R1(config-if)#ip mtu 1400

R1(config-if)#ip tcp adjust-mss 1360
R1(config-if)#tun
R1(config-if)#tunnel sou
R1(config-if)#tunnel source 192.168.1.1
R1(config-if)#tun
R1(config-if)#tunnel des
R1(config-if)#tunnel destination 192.168.2.1
R1(config-if)#
*Apr 2 12:31:19.039: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up

R2(config-if)#interface tunnel 0

*Apr 2 12:31:39.743: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to down
R2(config-if)#ip add
R2(config-if)#ip address 10.10.10.2 255.255.255.0
R2(config-if)#ip mt
R2(config-if)#ip mtu 1400
R2(config-if)#ip tc
R2(config-if)#ip tcp ad
R2(config-if)#ip tcp adjust-mss 1360
R2(config-if)#tun
R2(config-if)#tunnel sou
R2(config-if)#tunnel source 192.168.2.1
R2(config-if)#tun
R2(config-if)#tunnel des
R2(config-if)#tunnel destination 192.168.1.1
R2(config-if)#
*Apr 2 12:32:21.803: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up

For Access R2 Lan Site We Need Static Route Through GRE tunnel

ip route 192.168.3.0 255.255.255.0 10.10.10.2

For Access R1 Lan Site We Need Static Route Through GRE tunnel

ip route 192.168.4.0 255.255.255.0 10.10.10.1

Verification

R2#ping 192.168.4.1 source 192.168.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.3.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms

 

 

 

Related posts

Leave a Comment