The vpn-target command configures VPN targets for an MPLS L2VPN instance.
The undo vpn-target command deletes the VPN targets of an MPLS L2VPN instance.
By default, no VPN targets are configured for an MPLS L2VPN instance.
Parameter | Description | Value |
---|---|---|
vpn-target |
Specifies a VPN target. |
A VPN target can be in any of the following formats:
|
both |
Indicates both the import and export VPN targets. |
- |
import-extcommunity |
Indicates the import VPN target. |
- |
export-extcommunity |
Indicates the export VPN target. |
- |
all |
Deletes all VPN targets. |
- |
Usage Scenario
BGP VPWS uses VPN targets to control route exchange among nodes:
Prerequisites
An RD has been configured using the route-distinguisher route-distinguisher command for the MPLS L2VPN instance.
Configuration Impact
Two PEs can communicate only if the import VPN target of one PE matches the export VPN target of the other PE.
Precautions
If none of both, export-extcommunity, and import-extcommunity is specified, both is used by default.
<HUAWEI> system-view [~HUAWEI] mpls l2vpn [*HUAWEI-l2vpn] quit [*HUAWEI] mpls l2vpn vpn3 encapsulation vlan [*HUAWEI-mpls-l2vpn-vpn3] vpn-target 65537:30
<HUAWEI> system-view [~HUAWEI] mpls l2vpn [*HUAWEI-l2vpn] quit [*HUAWEI] mpls l2vpn vpn2 encapsulation vlan [*HUAWEI-mpls-l2vpn-vpn2] vpn-target 16.20:30
<HUAWEI> system-view [~HUAWEI] mpls l2vpn [*HUAWEI-l2vpn] quit [*HUAWEI] mpls l2vpn vpn1 encapsulation vlan [*HUAWEI-mpls-l2vpn-vpn1] undo vpn-target all
<HUAWEI> system-view [~HUAWEI] mpls l2vpn [*HUAWEI-l2vpn] quit [*HUAWEI] mpls l2vpn vpn1 encapsulation vlan [*HUAWEI-mpls-l2vpn-vpn1] undo vpn-target 100:100 import-extcommunity [*HUAWEI-mpls-l2vpn-vpn1] undo vpn-target 200:200 export-extcommunity
<HUAWEI> system-view [~HUAWEI] mpls l2vpn [*HUAWEI-l2vpn] quit [*HUAWEI] mpls l2vpn vpn1 encapsulation vlan [*HUAWEI-mpls-l2vpn-vpn1] vpn-target 100:100 import-extcommunity [*HUAWEI-mpls-l2vpn-vpn1] vpn-target 200:200 export-extcommunity