Configuring a tunnel interface
Configure a tunnel interface (Layer 3 virtual interface) on the devices at both ends of a tunnel. The devices use the tunnel interface to identify, process, and send packets for the tunnel.
To configure a tunnel interface:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Create a tunnel interface, specify the tunnel mode, and enter tunnel interface view. | interface tunnel number mode { advpn { gre | udp } [ ipv6 ] | ds-lite-aftr | evi [ ipv6 ] | gre [ ipv6 ] | ipsec [ ipv6 ] | ipv4-ipv4 | ipv6 | ipv6-ipv4 [ 6to4 | auto-tunnel | isatap ] | mpls-te | nve | nvgre | vxlan } | By default, no tunnel interfaces exist. When you create a new tunnel interface, you must specify the tunnel mode. When you enter the view of an existing tunnel interface, you do not need to specify the tunnel mode. For packet tunneling to succeed, the two ends of a tunnel must use the same tunnel mode. |
3. (Optional.) Configure a description for the interface. | description text | By default, the description for a tunnel interface is Tunnel number Interface. |
4. (Optional.) Specify a primary traffic processing slot for the tunnel interface. | In IRF mode:service slot slot-number | By default, no primary traffic processing slot is specified for an interface. |
5. (Optional.) Specify a backup traffic processing slot for the tunnel interface. | In IRF mode:service standby slot slot-number | By default, no backup traffic processing slot is specified for an interface. |
6. Set the MTU of the tunnel interface. | mtu size | By default, the MTU is 64000 bytes for a tunnel interface. |
7. Set the expected bandwidth for the tunnel interface. | bandwidth bandwidth-value | The default expected bandwidth (in kbps) is the interface maximum rate divided by 1000. The expected bandwidth for the tunnel interface affects the link cost value. For more information, see Layer 3—IP Routing Configuration Guide. |
8. Set the ToS for tunneled packets. | tunnel tos { tos-value | copy-inner-tos } | For VXLAN tunneled packets, the default ToS is 0. For non-VXLAN tunneled packets, the default ToS is the same as the ToS of the original packets. The copy-inner-tos keyword is supported only by VXLAN tunnels. |
9. Set the TTL for tunneled packets. | tunnel ttl ttl-value | The default TTL for tunneled packets is 255. |
10. Specify the VPN instance to which the tunnel destination belongs. | tunnel vpn-instance vpn-instance-name | By default, the tunnel destination belongs to the public network. For a tunnel interface to come up, the tunnel source and destination must belong to the same VPN. To specify a VPN instance for the tunnel source, use the ip binding vpn-instance command on the tunnel source interface. |
11. (Optional.) Restore the default settings of the tunnel interface. | default | N/A |
12. (Optional.) Shut down the tunnel interface. | shutdown | By default, a tunnel interface is down. |