Create or select a physical or loopback interface.
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 boston
Use the no version to remove
the tunnel.
Note:
When you delete a virtual router that has been configured as
a transport virtual router for a DVMRP tunnel, the show
configuration output displays No Router for the transport
virtual router. To remove the DVMRP tunnel interface, simply omit
any reference to the transport virtual router. For example, to delete interface tunnel dvmrp:boston-tunnel-1 transport-virtual-router No
Router from the configuration, issue the command, no interface tunnel dvmrp:boston-tunnel-1. bws: added @ 8.2.0 per gneyens; no plan to fix Defect ID 44810
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.
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.
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.
Figure 20: 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.