Configuring Tunnel Interfaces
A tunnel allows direct connection between a remote location and an application running on the C-series platform; a tunnel lets you use the redirect server in deployments where the JUNOSe router does not have a direct connection to the C-series platform.
The C-series platform supports two types of tunnel interfaces:
- GRE—Encapsulates traffic that can use various network protocols within IP. For C-series platforms, the tunnel interface encapsulates IP packets.
- IP-over-IP—Encapsulates IP packets within IP packets.
The other endpoint for the tunnel on a JUNOS or JUNOSE router must be configured for the tunnel to be operational.
Use the following configuration statements to configure tunnel interfaces at the [edit] hierarchy level:
interfacesname
unitunit-number
tunnel {mode (ipip | gre);destinationdestination
;sourcesource;
keykey
;interfaceinterface
;ttlttl
;}interfacesname
unitunit-number
family inet {addressaddress
;}To configure a tunnel interface on a C-series platform:
- From configuration mode, access the configuration statement that configures tunnel interfaces.
[edit]user@host#edit interfaces
name
unit
unit-number
tunnel
[edit]user@host#edit interfaces ip-tunnel unit t0 tunnel
- Configure the type of tunnel, IP-over-IP or GRE.
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set mode ipip
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set mode gre
- Specify the IP address of the remote end of the tunnel.
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set destination
destination
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set destination
192.0.2.20
- (Optional) Specify an IP address that will not change to receive tunneled packets.
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set source
source
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set source 192.20.10.5
If you specify a source address, Step 6 is required.
- (Optional) For a GRE tunnel, specify a key.
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set key
key
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set key 250
- (Optional. Required if you specify a source address.) Specify an existing physical interface on the C-series platform.
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set interface
interface
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set interface eth0
- (Optional) Specify the lifetime of tunneled packets.
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set ttl
ttl
[edit interfaces ip-tunnel unit t0 tunnel]user@host#set ttl 110
- Configure an IP address for the tunnel interface. This IP address is used to connect to a device at the other end of the tunnel. For example:
[edit interfaces ip-tunnel unit t0 tunnel]user@host#up
[edit interfaces ip-tunnel unit t0]user@host#edit family inet
[edit interfaces ip-tunnel unit t0 family inet]user@host# set address 10.0.1.1/24- Verify the configuration by running the
show
command. For example:[edit interfaces]user@host#show
ip-tunnel {unit t0 {family {inet {address 10.0.1.1/24;}
}
tunnel {
mode ipip;
destination 192.0.2.20;
source 192.20.10.5;
interface eth0;
ttl 110;
}
}
}