Configuring a Tunnel

To configure a GRE tunnel that supports both IPv4 and IPv6 traffic through the same tunnel, do the following:

  1. Configure the following on one end of the GRE tunnel.
    1. Enter global configuration mode.
      device# configure terminal
    2. Use the interface tunnel command to enter interface configuration mode and configure a tunnel. Here we are configuring tunnel with ID 20.
      device (config)# interface tunnel 22
      The valid range for tunnel IDs is from 1 through 1024.
    3. Use the mode gre ip command to configure GRE encapsulation over IP as the tunnel's mode.
      device(config-intf-tunnel-20)# mode gre ip
    4. Use the source command to configure source interface of the tunnel. Here, we are configuring a loopback interface as the source.
      device(config-intf-tunnel-20)# source loopback 10
      An IPv4 address, Ethernet, loopback, and VE interfaces can be configured as the source. The maximum number of supported tunnel sources is 15 for SLX 9540 and SLX 9640 and 255 for SLX 9740/Extreme 8820.
      Note

      Note

      When the physical/ve interface is specified as the source of the GRE tunnel, the lowest IP address of that interface is used as the tunnel source IP address. If the smallest IP address is removed from the interface, the next smallest IP address is then used as the tunnel source.
    5. Use the destination command to configure destination IP address. This must be the IP address assigned to the other tunnel end point.
      device(config-intf-tunnel-20)# destination 32.32.32.2
    6. Use router-interface command to configure a router interface for the tunnel. The Router Interface configures some important tunnel parameters.
      device(config-intf-tunnel-20)# router-interface ve 20
      Note

      Note

      The tunnel Source VE and the Router Interface VE cannot be the same.

    7. Use the no shutdown command to configure the tunnel to remain up.
      device(config-intf-tunnel-20)# no shutdown
  2. Configure the following on the other end of the GRE tunnel.
    1. Enter global configuration mode.
      device# configure terminal
    2. Use the interface tunnel command to enter interface configuration mode and configure a tunnel. Here we are configuring tunnel with ID 22.
      device (config)# interface tunnel 22
      The valid range for tunnel IDs is from 1 through 1024.
    3. Use the mode gre ip command to configure GRE encapsulation over IP as the tunnel's mode.
      device(config-intf-tunnel-22)# mode gre ip
    4. Use the source command to configure source interface of the tunnel. Here, we are configuring a loopback interface as the source.
      device(config-intf-tunnel-22)# source loopback 10
      An IPv4 address, Ethernet, loopback, and VE interfaces can be configured as the source. The maximum number of supported tunnel sources is 15 for SLX 9540 and SLX 9640 and 255 for SLX 9740/Extreme 8820.
      Note

      Note

      When the physical/ve interface is specified as the source of the GRE tunnel, the lowest IP address of that interface is used as the tunnel source IP address. If the smallest IP address is removed from the interface, the next smallest IP address is then used as the tunnel source.
    5. Use the destination command to configure destination IP address. This must be the IP address assigned to the other tunnel end point.
      device(config-intf-tunnel-22)# destination 32.32.32.1
    6. Use router-interface command to configure a router interface for the tunnel. The Router Interface configures some important tunnel parameters.
      device(config-intf-tunnel-22)# router-interface ve 20
      Note

      Note

      The tunnel Source VE and the Router Interface VE cannot be the same.

    7. Use the no shutdown command to configure the tunnel to remain up.
      device(config-intf-tunnel-22)# no shutdown
 interface tunnel 20 
 mode gre ip
 source loopback 10
 destination 31.31.31.2
 router-interface ve 20
 no shutdown 

The following is the consolidation of the above steps to create a GRE tunnel on one of the tunnel end points.

interface tunnel 22 
 mode gre ip
 source loopback 10
 destination 31.31.31.1
 router-interface ve 22
 no shutdown