Configuration Tasks
This interface acts as an anchor for the source of the tunnel.
- Assign an IP address to the physical or loopback interface.
- Create a tunnel interface.
- Set the source address for the tunnel.
- Set the destination address for the tunnel.
- (Optional) Enable error checking across a GRE tunnel.
- 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
- Use to create an IP tunnel interface.
- Specify the type and name of the tunnel you want to create.
- You can use the transport-virtual-router keyword to establish the tunnel on a virtual router other than the current virtual router.
- Example
host1(config)#interface tunnel dvmrp:boston-tunnel-1 transport-virtual-router bostonUse the no version to remove the tunnel.
tunnel checksum
- Use to enable checksum computation across a GRE tunnel.
- Checksum computation is not supported for DVMRP tunnels.
- Selecting this feature causes the E-series router to drop corrupted packets it receives on the tunnel interface.
- Example
host1(config)#interface tunnel gre:tunnel2host1(config-if)#tunnel checksumUse the no version to disable the checksum option. tunnel destination
- Use to configure the remote end of the tunnel.
- Specify either the IP address of an interface on the remote router or the hostname of the remote router.
- The IP address is the address for the destination interface.
- The hostname is the name of the destination interface.
host1(config)#interface tunnel dvmrp:tunnel2host1(config-if)#tunnel destination 192.13.7.1Example 2 host1(config)#interface tunnel dvmrp:tunnel2host1(config-if)#tunnel destination remoteHostUse the no version to remove the destination of a tunnel. tunnel mtu
host1(config-if)#tunnel mtu 7500Use the no version to restore the default, 10240 bytes. tunnel source
- Use to configure the source of the tunnel.
- Specify either the primary IP address or the type and specifier of an interface.
- Do not specify an unnumbered interface.
- Example 1Primary IP address
host1(config)#interface tunnel dvmrp:boston-tunnel-1host1(config-if)#tunnel source 192.10.2.1Example 2ATM interface on an ERX-7xx model, ERX-14xx model, or the ERX-310 router that uses the slot/port format host1(config)#interface tunnel dvmrp:boston-tunnel-1host1(config-if)#tunnel source atm 5/0.12Example 3ATM interface on an E320 router that uses the slot/adapter/port format host1(config)#interface tunnel dvmrp:boston-tunnel-1host1(config-if)#tunnel source atm 5/1/0.12Use the no version to remove the source of a tunnel. 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 ERX-7xx model, ERX-14xx model, or ERX-310 router that uses the slot/port format.
- Configure a virtual router called boston that supports one end of the tunnel.
host1#virtual-router boston- 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.5host1:boston(config-if)#ip address 10.5.5.5 255.255.255.0
- Create the tunnel interface.
host1:boston(config)#interface tunnel gre:ChicagoTunnel- Configure the source and destination points of the tunnel interface.
host1:boston(config-if)#tunnel source 10.5.5.5host1:boston(config-if)#tunnel destination 10.6.6.6- Set the MTU for the tunnel.
host1:boston(config-if)#tunnel mtu 8000- Configure the IP address of the tunnel interface.
host1:boston(config-if)#ip address 10.7.7.7 255.255.255.0
- Configure a virtual router called chicago that supports the other end of the tunnel.
host1(config)#virtual-router chicago- Configure a physical or loopback interface for the end of the tunnel on virtual router chicago.
host1:chicago(config)#interface atm 12/1.5host1:chicago(config-if)#ip address 10.6.6.6 255.255.255.0- Configure the tunnel interface on virtual router chicago.
The name of the tunnel interface can differ from the tunnel interface configured in Step 3.
host1:chicago(config-if)#interface tunnel gre:BostonTunnelThe 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.6host1:chicago(config-if)#tunnel destination 10.5.5.5The MTU must match the MTU configured in Step 3.
host1:chicago(config-if)#tunnel mtu 8000
- Configure the IP address of the tunnel interface.
host1:chicago(config-if)#ip address 10.9.9.9 255.255.255.0Configuring 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:
- Use different routing protocols for the tunnel network and the transport networks.
- Define a static route to the tunnel destination.
NOTE: If you define a static route to a tunnel destination, be careful not to create routing loops.
Figure 20 illustrates how to prevent recursive tunnels by using different routing protocols for the tunnel network and the transport networks.
![]()
Creating Multicast VPNs Using GRE Tunnels
For information about configuring multicast VPNs using GRE tunnels, see JUNOSe Multicast Routing Configuration Guide, Chapter 7, Configuring PIM for IPv4 Multicast.