Configuring Optional IP GRE Tunnel Parameters
Optional parameters for GRE tunnels include changing the maximum transmission unit (MTU) value, enabling GRE keepalives, and changing the maximum number of supported GRE tunnels. These configuration options are explained in more detail in the following steps.
- Enter global configuration mode.
- Enter interface configuration mode and specify an Ethernet interface.
- Assign an IP address to Ethernet port 1/1/1.
- Return to global configuration mode to configure the GRE tunnel interface.
- Create a tunnel interface.
- (Optional) Change the MTU value for the tunnel interface.
When changing the GRE tunnel MTU, set the MTU to at least 24 bytes less than the IP MTU of the outgoing interface. If the MTU is not set to at least 24 bytes less than the IP MTU, the size of the encapsulated packet will exceed the IP MTU of the outgoing interface. This will cause the packet to either be sent to the CPU for fragmentation, or the packet will be dropped if the DF (Do-Not-Fragment) bit is set in the original IP packet, and an ICMP message is sent.
- (Optional) Configure a GRE link
keepalive. To enable GRE link keepalive, configure it on one end of the tunnel and ensure the other end of the tunnel has GRE enabled.
In this example, the device to waits for 4 consecutive lost keepalive packets before bringing the tunnel down. There will be a 12 second interval between each packet. Note that when the tunnel comes up, it would immediately (within one second) send the first keepalive packet.
- (Optional) Return to global configuration mode. The remaining steps in this task are required only if you want to change the maximum number of supported GRE tunnels for your device.
- Change the maximum number of supported GRE tunnels.
device(config)# system-max gre-tunnels 16 Reload required. Please write memory and then reload or power cycle.
Check the table in the GRE tunnel parameters section to determine how many GRE tunnels your device can support. - Save the current configuration to memory before reloading.
- Return to privileged EXEC mode.
- Reload the device to ensure that the number of GRE tunnels supported is changed.
Allow time for the device to reload the software.
The following example configures optional parameters for an IP GRE tunnel.
device# configure terminal device(config)# interface ethernet 1/3/1 device(config-if-e1000-1/3/1)# ip address 10.0.8.108/24 device(config)# exit device(config)# interface tunnel 1 device(config-tnif-1)# ip mtu 1200108 device(config-tnif-1)# keepalive 12 4 device(config-tnif-1)# exit device(config)# system-max gre-tunnels 16 device(config)# write memory Reload required. Please write memory and then reload or power cycle. device(config)# exit device(config)# reload