The source command configures the source address or source interface of the tunnel.
The undo source command deletes the configured source address or source interface.
The source address and source interface of a tunnel are not specified by default.
Parameter |
Description |
Value |
---|---|---|
source-ip-address |
Specifies the source address of a tunnel interface. If a tunnel interface works in IPv4-IPv6 mode, specify an IPv6 address as the source address of the tunnel interface. |
The IPv4 address is in dotted decimal notation. The IPv6 address is a 32-digit hexadecimal number, in the format X:X:X:X:X:X:X:X. |
interface-type interface-number |
Specifies the type and the number of the source interface of the tunnel. The following types of interfaces are often used: VLNAIF and loopback. |
- |
Usage Scenario
When configuring a GRE, MPLS TE, IPv4 over IPv6 tunnel or manual IPv6 over IPv4 tunnel, create a tunnel interface. After a tunnel interface is created, run the source command to specify the source IP address for the tunnel interface.
Prerequisites
A tunnel interface has been created using the interface tunnel command, and the encapsulation mode is set to GRE, MPLS TE, IPv4 over IPv6 or IPv6 over IPv4 of manual mode using the tunnel-protocol command.
Precautions
Two tunnel interfaces with the same encapsulation mode, source address, and destination address cannot be configured simultaneously.
You can configure a main interface working in Layer 3 mode as the source tunnel interface.
On the GRE, MPLS TE, IPv4 over IPv6 tunnel or manual IPv6 over IPv4 tunnel, the source address of the local tunnel interface is the destination address of the remote tunnel interface, and the destination address of the local tunnel interface is the source address of the remote tunnel interface.
<HUAWEI> system-view [HUAWEI] interface tunnel 1 [HUAWEI-Tunnel1] tunnel-protocol ipv6-ipv4 [HUAWEI-Tunnel1] source 10.1.1.1
<HUAWEI> system-view [HUAWEI] interface Loopback 1 [HUAWEI-LoopBack1] ip address 10.2.1.1 32 [HUAWEI-LoopBack1] quit [HUAWEI] interface tunnel 1 [HUAWEI-Tunnel1] tunnel-protocol gre [HUAWEI-Tunnel1] source loopback 1