Configuration Tasks

To configure an IP tunnel:

  1. Create or select a physical or loopback interface.

    This interface acts as an anchor for the source of the tunnel.

  2. Assign an IP address to the physical or loopback interface.
  3. Create a tunnel interface.
  4. Set the source address for the tunnel.
  5. Set the destination address for the tunnel.
  6. (Optional) Enable error checking across a GRE tunnel.
  7. Set the maximum transmission unit (MTU) size for the tunnel.

    Note: On SM interfaces, issue only the commands listed below. Do not configure protocols such as Multilink PPP or Multilink Frame Relay on SM interfaces.

interface tunnel

tunnel checksum

tunnel destination

tunnel mtu

tunnel source

Configuration Example

In this example, two GRE tunnel interfaces are configured on different virtual routers of an E Series router. The source of the first tunnel interface matches the destination of the second tunnel interface and vice versa.

Note: This example contains an ATM interface configuration for an ERX7xx model, ERX14xx model, or ERX310 router that uses the slot/port format.

  1. Configure a virtual router called boston that supports one end of the tunnel.
    host1#virtual-router boston
  2. Configure a physical or loopback interface for the end of the tunnel on virtual router boston.

    The IP address of this interface appears in the header of tunneled frames and is used for forwarding traffic.

    host1:boston#interface atm 12/0.5 host1:boston(config-if)#ip address 10.5.5.5 255.255.255.0
  3. Configure the tunnel interface on virtual router boston.
    1. Create the tunnel interface.
      host1:boston(config)#interface tunnel gre:ChicagoTunnel
    2. Configure the source and destination points of the tunnel interface.
      host1:boston(config-if)#tunnel source 10.5.5.5 host1:boston(config-if)#tunnel destination 10.6.6.6
    3. Set the MTU for the tunnel.
      host1:boston(config-if)#tunnel mtu 8000
    4. Configure the IP address of the tunnel interface.
      host1:boston(config-if)#ip address 10.7.7.7 255.255.255.0
  4. Configure a virtual router called chicago that supports the other end of the tunnel.
    host1(config)#virtual-router chicago
  5. Configure a physical or loopback interface for the end of the tunnel on virtual router chicago.
    host1:chicago(config)#interface atm 12/1.5 host1:chicago(config-if)#ip address 10.6.6.6 255.255.255.0
  6. Configure the tunnel interface on virtual router chicago.
    1. Create the tunnel interface.

      The name of the tunnel interface can differ from the tunnel interface configured in Step 3.

      host1:chicago(config-if)#interface tunnel gre:BostonTunnel
    2. Configure the source and destination points of the tunnel interface.

      The destination of this tunnel interface matches the source of the tunnel interface configured in Step 3 and vice versa.

      host1:chicago(config-if)#tunnel source 10.6.6.6 host1:chicago(config-if)#tunnel destination 10.5.5.5
    3. Set the MTU for the tunnel.

      The MTU must match the MTU configured in Step 3.

      host1:chicago(config-if)#tunnel mtu 8000
    4. Configure the IP address of the tunnel interface.
      host1:chicago(config-if)#ip address 10.9.9.9 255.255.255.0

Configuring IP Tunnels to Forward IP Frames

When a line module receives IP frames destined for a tunnel, the module forwards the frames to a tunnel-service module. Tunnel-service modules include SMs and modules that support the use of shared tunnel-server ports.

The tunnel-service module encapsulates the frames and forwards them to the tunnel through an interface determined by a route lookup of an IP frame. The source and destination addresses in the IP frame are the source and destination addresses of the tunnel.

Similarly, when a line module receives traffic from a tunnel, the module forwards the traffic to the tunnel-service module for deencapsulation. After deencapsulation, the tunnel-service module forwards the resulting IP frames to an interface determined by a route lookup.

When you have configured a tunnel interface, treat it in the same way as any IP interface on the router. For example, you can configure static IP routes or enable routing protocols on the tunnel interface. The IP configurations you apply to the tunnels control how traffic travels through the network.

Preventing Recursive Tunnels

If routing information about the tunnel network combines with routing information about the transport networks (the networks that the tunnel services), a recursive tunnel can occur. In this case, the routing table defines the tunnel itself as the best path to a tunnel destination. To prevent recursive tunnels, differentiate routing information for the tunnel network and the transport networks with one or both of the following techniques:

Figure 20 illustrates how to prevent recursive tunnels by using different routing protocols for the tunnel network and the transport networks.

Figure 20: Transport and Tunnel Networks Using Different Routing Protocols

Transport and Tunnel Networks Using Different
Routing Protocols

Creating Multicast VPNs Using GRE Tunnels

For information about configuring multicast VPNs using GRE tunnels, see Configuring PIM for IPv4 Multicast in JunosE Multicast Routing Configuration Guide.