The mpls static-l2vc command creates a static VC.
The undo mpls static-l2vc command deletes the static VCs.
By default, no static VC is created.
mpls static-l2vc { { destination ip-address | pw-template pw-template-name vc-id } * | destination ip-address vc-id } transmit-vpn-label transmit-label-value receive-vpn-label receive-label-value [ tunnel-policy tnl-policy-name | [ control-word | no-control-word ] | [ raw | tagged ] ] *
undo mpls static-l2vc
undo mpls static-l2vc { { destination ip-address | pw-template pw-template-name vc-id } * | destination ip-address vc-id } transmit-vpn-label transmit-label-value receive-vpn-label receive-label-value [ tunnel-policy tnl-policy-name | [ control-word | no-control-word ] | [ raw | tagged ] ] *
Parameter |
Description |
Value |
---|---|---|
destination ip-address |
Specifies the LSR ID of a peer device on the PW. |
The value is in dotted decimal notation. |
pw-template pw-template-name |
Specifies the name of a static PW template. |
The value is a string of 1 to 19 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
vc-id |
Specifies the VC ID. |
The value is an integer that ranges from 1 to 4294967295. |
transmit-vpn-label transmit-label-value |
Specifies the value of a transmit label. |
The value is an integer that ranges from 0 to 1048575. |
receive-vpn-label receive-label-value |
Specifies the value of a receive label. |
The value is an integer that ranges from 16 to 1023. |
tunnel-policy tnl-policy-name |
Specifies the name of a tunnel policy. |
The value is a string of 1 to 39 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
control-word | no-control-word |
Enables or disables the control word function. By default, the control word function is disabled. |
- |
raw |
Removes the provider-tag (P-Tag) from a packet. |
- |
tagged |
Retains the P-Tag in a packet. |
- |
Usage Scenario
In an L2VPN networking, you can use this command to create a static VC between two PEs connected to CEs.
Precautions
An interface cannot function as an L2VPN AC interface and L3VPN AC interface at the same time. After an interface is bound to an L2VPN, Layer 3 features such as the IP address and routing protocol on this interface become invalid.
You can set attributes for a static PW template, including the remote peer, tunnel policy, control word, and VCCV. When configuring a static PW, you can directly use the static PW template without specifying attributes for the PW. After setting attributes for a static PW template, you can update the static PW template at any time. The modified static PW template takes effect only after the reset pw command is run.
Static VCs must be created on PEs at both ends. The destination address of a VC is the LSR ID of the peer PE. The transmit label of the PE at one end is the receive label of the PE at the other end. If the labels do not match, traffic may fail to be forwarded even though the static-12vc field is displayed as Up.
If no tunnel policy is specified, the default tunnel policy is used. The default policy specifies that traffic is forwarded along the LSP and only one tunnel is used for load balancing. If a tunnel policy name is specified but the tunnel policy is not configured, the default tunnel policy is used.
When configuring a static VC, note that the value of the transmit label ranges from 0 to 1048575. This ensures the communication between the device and different types of devices.
When creating static VCs, the latest configurations of some parameters override the previous ones. The parameters include tunnel-policy tnl-policy-name, control-word, and no-control-word.
By default, link type negotiation is enabled globally on the device. If a VLANIF interface is used as an AC-side interface for L2VPN, the configuration conflicts with link type negotiation. In this case, run the lnp disable command in the system view to disable link type negotiation.
# Configure a static VC. Set the LSR ID of the peer device to 1.1.1.1, transmit label to 100, and receive label to 100.
<HUAWEI> system-view [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] mpls static-l2vc destination 1.1.1.1 transmit-vpn-label 100 receive-vpn-label 100
# Configure a static VC by applying a PW template and set values of the VC ID, transmit label, and receive label to 100 respectively.
<HUAWEI> system-view [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] mpls static-l2vc pw-template pwt 100 transmit-vpn-label 100 receive-vpn-label 100
# Delete a static VC.
<HUAWEI> system-view [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] undo mpls static-l2vc