GRE protocol:
– Defined in RFC 2784.
– Port 47.
– Protocol in its own right (we have the TCP, the UDP AND the GRE).
– Adds a 24-byte header (IP header of 20 bytes – 4 GRE bytes).
– Tunnel NOT ENCRYPTEd.
– possibility to encrypt our GRE tunnel via IPsec.
Advantage of an GRE tunnel:
– Flexibility.
– Transit multicast streams (Video, Packet Hello) through a WAN network.
Presentation
In a world without GRE
Imagine a company present on two remote geographical sites each with 3 network address ranges:
Site 1:
– Lan 11
– Lan 12
– Lan 13
Site 2:
– Lan 21
– Lan 22
– Lan 23
These two sites are linked via a service provider. Let's call this network WAN Network.

Consequences:
– The WAN network knows all our IP address ranges
– Unable to move multicast streams
– If we create a new address range, we must inform our ISP (and this has a cost)
In a world with GRE

Consequences:
– The WAN network only knows our WAN IP.
– Multicast streams can be routed.
– If you create a new address range, you don't need to inform our ISP (and that has a cost)
Encapsulation
But what's really going on?

– The R1 Router gets a package of Lan 11 for the LAN 12
– R1 will encapsulate this package in its entirety and will add its Source IP address (1.1.1.1) and the R2 router's WAN address (2.2.2.1)
– Our GRE package will pass through the WAN network
– R2 receives this package, unencapsist it, and hands it over to the real recipient (Lan 21).
What gives us:

configuration

PARIS Router
Router-PARIS (config) - tunnel interface10 Router-PARIS (config-if) - PARIS-NICE description Router-PARIS (config-if) ip address 1.1.10.1 255.255.255.248 Router-PARIS (config-if) - source tunnel A.A.A.2 Router-PARIS (config-if) tunnel destination B.B.B.2 Router-PARIS (config) - tunnel interface20 Router-PARIS (config-if) - description PARIS-TOURS Router-PARIS (config-if) ip address 1.1.20.1 255.255.255.255.248 Router-PARIS (config-if) - source tunnel A.A.A.2 Router-PARIS (config-if) - tunnel destination C.C.C.2
NICE router
Router-NICE (config) - tunnel interface10 Router-NICE (config-if) - PARIS-NICE description Router-NICE (config-if) ip address 1.1.10.2 255.255.255.248 Router-NICE (config-if) - b.B.B.2 source tunnel Router-NICE (config-if) tunnel destination A.A.A.2
TOURS router
Router-TOURS (config) - tunnel interface20 Router-TOURS (config-if) - description PARIS-TOURS Router-TOURS (config-if) ip address 1.1.20.2 255.255.255.255.248 Router-TOURS (config-if) - C.C.C.2 source tunnel Router-TOURS (config-if) tunnel destination A.A.A.2
Routing
When it comes to routing, we need to distinguish between two worlds:
Before the assembly of the GRE Tunnels (Underlying).
When the GRE tunnels are mounted (Overlay).
Underlying

The PARIS site wants to set up a GRE tunnel with NICE.
The GRE tunnel will have as IP source the WAN leg of the PARIS site router and as IP destination the WAN leg of the NICE site router.
It will therefore be necessary to indicate by which path the router of PARIS will be able to join the WAN leg of the NICE site router. (And vice versa).
Overlay

All our customer sites will learn their routes by default via the OSPF protocol.
The default route will therefore be their GRE tunnels.
This protocol will also allow customer sites to announce to the host site the networks present on their geographical sites.
Hoping this article has been helpful to you! Don't hesitate to let me know!!
This site has other network items, take the opportunity to browse the menu bar!
FingerInTheNet.com
