The vpn-target command associates a particular VPN with one or more VPN targets (VTs).
The undo vpn-target command deletes the VTs associated with a particular VPN.
By default, no VPN target is specified for an L2VPN.
vpn-target vpn-target &<1-16> [ both | export-extcommunity | import-extcommunity ]
undo vpn-target { all | vpn-target &<1-16> [ both | export-extcommunity | import-extcommunity ] }
Parameter | Description | Value |
---|---|---|
vpn-target | Adds a VPN target to the VPN. A VPN target can use any of the following formats:
|
- |
import-extcommunity | Receives routing information carrying specified extended community attributes. | - |
export-extcommunity | Specifies the extended community attributes carried in routing information to be sent. | - |
both | Specifies the extended community attributes of the received and the sent routing information. | - |
all | Deletes all the VTs. | - |
Usage Scenario
In a Kompella VLL networking, you can use this command to set the VPN target attribute for an L2VPN instance. The VPN target is used to set up a remote PW.
Precautions
If you do not specify any keywords, both is used by default.
Before configuring a VPN target, configure the Route Distinguisher (RD) for the L2VPN instance.
# Configure the VTs for an L2VPN named vpn1.
<HUAWEI> system-view [HUAWEI] mpls l2vpn vpn1 encapsulation vlan [HUAWEI-mpls-l2vpn-vpn1] vpn-target 100:1 [HUAWEI-mpls-l2vpn-vpn1] vpn-target 1:1 2:2 export-extcommunity [HUAWEI-mpls-l2vpn-vpn1] vpn-target 1.2.3.4:11 12:12 import-extcommunity
# Delete the VT of vpn1.
<HUAWEI> system-view [HUAWEI] mpls l2vpn vpn1 encapsulation vlan [HUAWEI-mpls-l2vpn-vpn1] undo vpn-target 12:12 import-extcommunity
# Delete all the VTs of vpn1.
<HUAWEI> system-view [HUAWEI] mpls l2vpn vpn1 encapsulation vlan [HUAWEI-mpls-l2vpn-vpn1] undo vpn-target all