Configuring Optional IP GRE Tunnel Parameters

There are a few options that can be configured for IP GRE tunnels.
Before configuring this task, review the “Configuring IP GRE tunnels” task to view the required steps for creating GRE tunnels. In this task, it is assumed that you have already configured the GRE tunnel.

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.

  1. Enter global configuration mode.
    device# configure terminal
  2. Enter interface configuration mode and specify an Ethernet interface.
    device(config)# interface ethernet 1/1/1
  3. Assign an IP address to Ethernet port 1/1/1.
    device(config-if-e10000-1/1/1)# ip address 10.45.6.1 255.255.255.0
  4. Return to global configuration mode to configure the GRE tunnel interface.
    device(config-if-e10000-1/1/1)# exit
  5. Create a tunnel interface.
    device(config)# interface tunnel 1
  6. (Optional) Change the MTU value for the tunnel interface.
    device(config-tnif-1)# ip mtu 1200
    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.
  7. (Optional) Configure a GRE link keepalive.
    device(config-tnif-1)# keepalive 12 4
    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.

  8. (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.
    device(config-tnif-1)# exit
  9. Change the maximum number of supported GRE tunnels.
    device(config)# system-max gre-tunnels 64
    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.
  10. Save the current configuration to memory before reloading.
    device(config)# write memory
  11. Return to privileged EXEC mode.
    device)# exit
  12. Reload the device to ensure that the number of GRE tunnels supported is changed.
    device)# reload
    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 64
device(config)# write memory
Reload required. Please write memory and then reload or power cycle.
device(config)# exit
device(config)# reload