Generic Routing Encapsulation (GRE)

ccnp-routing
Notes on GRE tunneling covering the header overhead, common use cases such as GRE over IPsec and IPv6 transport, and a working two router lab.
Published

Jan 24, 2018

Common GRE use cases

  • Tunneling private IP traffic over a public IP network
    • GRE over IPsec is very commonly used for LAN-to-LAN VPN tunnels
    • Tunnel encrypted private traffic through the public internet
  • Now the question is why not use IPsec by itself?
    • Because IPsec can only protect unicast packets but GRE can encapsulate multicast traffic
  • Carrying a protocol not routed in your environment over IP network
    • Tunneling IPv6 over IPv4 networks
    • Tunneling IPX, Appletalk, NetBIOS, whatever through your IP network
  • Joining two similar networks together that are separated by a dissimilar network
    • Disjointed OSPF areas or IGP domains
    • Allows you to easily run a routing protocol between two routers that are not physically connected

gre
R1
hostname R1
!
interface Tunnel0
 ip address 172.16.10.1 255.255.255.0
 ip mtu 1400
 ip tcp adjust-mss 1360
 tunnel source GigabitEthernet0/1
 tunnel destination 2.2.2.2
!
interface GigabitEthernet0/0
 ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet0/1
 ip address 1.1.1.1 255.255.255.252
!
ip route 2.2.2.2 255.255.255.255 GigabitEthernet0/1
ip route 192.168.2.0 255.255.255.0 172.16.10.2
R2
hostname R2
!
interface Tunnel0
 ip address 172.16.10.2 255.255.255.0
 ip mtu 1400
 ip tcp adjust-mss 1360
 tunnel source GigabitEthernet0/1
 tunnel destination 1.1.1.1
!
interface GigabitEthernet0/0
 ip address 192.168.2.1 255.255.255.252
!
interface GigabitEthernet0/1
 ip address 2.2.2.2 255.255.255.252
!
ip route 1.1.1.1 255.255.255.255 GigabitEthernet0/1
ip route 192.168.1.0 255.255.255.0 172.16.10.1
Internet
hostname Internet
!
interface GigabitEthernet0/1
 ip address 1.1.1.2 255.255.255.252
!
interface GigabitEthernet0/2
 ip address 2.2.2.1 255.255.255.0
Back to top