GRE Tunnel Modes

Our Simple Dual Stack Topology

Tunnel mode gre ip

By default a tunnel uses the mode tunnel mode gre ip.

A simple ping from R1’s loopback to R2’s loopback looks like this:

vIOS1#ping 192.168.200.1 source loopback 0 repeat 2

Internet Protocol Version 4, Src: 73.243.100.2, Dst: 73.243.100.1
Generic Routing Encapsulation (IP)
Flags and Version: 0x0000
Protocol Type: IP (0x0800)
Internet Protocol Version 4, Src: 192.168.200.1, Dst: 192.168.100.1
Internet Control Message Protocol

But wait we can also use it for GRE IPv6 without changing the mode!

vIOS1(config-if)#do ping 2001:db8:2222::1 so l0 re 2

Internet Protocol Version 4, Src: 73.243.100.1, Dst: 73.243.100.2
Generic Routing Encapsulation (IPv6)
Flags and Version: 0x0000
Protocol Type: IPv6 (0x86dd)
Internet Protocol Version 6, Src: 2001:db8:1111::1, Dst: 2001:db8:2222::1
Internet Control Message Protocol v6

The only thing that has changed is the GRE Protocol Type to IPv6 0x86dd. So what gives; why are there so many types?

Tunnel mode gre ipv6

When this mode is selected it is necessary to have an IPv6 destination and source. The tunnel will use IPv6 as the underlay or carrier protocol.

vIOS1(config-if)#do ping 192.168.200.1 so l0 re 2

Internet Protocol Version 6, Src: 2001:db8:abcd::1, Dst: 2001:db8:abcd::2
Generic Routing Encapsulation (IP)
Flags and Version: 0x0000
Protocol Type: IP (0x0800)
Internet Protocol Version 4, Src: 192.168.100.1, Dst: 192.168.200.1
Internet Control Message Protocol

Tunnel mode ipv6ip

Now we’re at the weird tunnels. This is no longer using GRE encapsulation. Instead the IPv4 header’s protocol field states that it’s IPv6. Confusing right?

This mode requires an Ipv4 destination configured.

vIOS1(config-if)#do ping 2001:db8:2222::1 re 2

Internet Protocol Version 4, Src: 73.243.100.2, Dst: 73.243.100.1
0100 …. = Version: 4
…. 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length: 120
Identification: 0x0037 (55)
Flags: 0x00
Fragment offset: 0
Time to live: 255
Protocol: IPv6 (41)
Header checksum: 0x5f3c [validation disabled]
[Header checksum status: Unverified]
Source: 73.243.100.2
Destination: 73.243.100.1
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Internet Protocol Version 6, Src: 2001:db8:2222::1, Dst: 2001:db8:ef::1
Internet Control Message Protocol v6

Tunnel mode ipv6

This requires an IPv6 destination address. Once again, there is no GRE in sight. Instead the IPv6 Next Header field specifies that it’ll be IPv4.

vIOS1(config-if)#do ping 192.168.200.1 so l0 re 2

Internet Protocol Version 6, Src: 2001:db8:abcd::1, Dst: 2001:db8:abcd::2
0110 …. = Version: 6
…. 0000 0000 …. …. …. …. …. = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
…. …. …. 0000 0000 0000 0000 0000 = Flow Label: 0x00000
Payload Length: 100
Next Header: IPIP (4)
Hop Limit: 255
Source: 2001:db8:abcd::1
Destination: 2001:db8:abcd::2
[Source GeoIP: Unknown]
[Destination GeoIP: Unknown]
Internet Protocol Version 4, Src: 192.168.100.1, Dst: 192.168.200.1
Internet Control Message Protocol

That’s all I wrote!