The vpn-target command associates a VSI in a BGP AD VPLS domain with one or more VPN targets.
The undo vpn-target command removes the VPN targets associated with the VSI.
By default, a VSI is not associated with any VPN target. The association must be configured when a VSI is created.
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 | Associates a VPN target with a VSI. | The format of a VPN target can be one of the following:
|
both | Specifies the extended community attributes of the received and sent routing information. | - |
export-extcommunity | Specifies the extended community attributes carried in routing information to be sent. | - |
import-extcommunity | Receives routing information carrying specified extended community attributes. | - |
all | Deletes all VPN targets. | - |
Usage Scenario
VPN targets can be used in a BGP AD VPLS domain to control the route advertisement and communication between nodes. When a PE advertises routing information to other PEs of different VSIs, it adds export VPN targets to the routing information. When the PE receives routing information from other PEs, it uses import VPN targets to determine whether to import the routing information to the VSIs on it.
Prerequisites
The VPLS ID has been configured using the vpls-id vpls-id command in the VSI-BGPAD view.
Precautions
A PW can be set up between two VSIs in a BGP AD VPLS domain only when the import VPN target associated with a VSI is the same as the export VPN target associated with the other VSI.
After the vpn-target command is run, the PE only advertises the routing information that contains the export VPN targets and imports the routing information that contains the import VPN targets. Two PEs are allowed to communicate with each other only when the VPN targets carried in their exchanged routing information match.
# Configure a VSI named company2, and associate the VSI with import VPN targets 4:4 and 5:5 and with export VPN targets 3:3 and 5:5.
<HUAWEI> system-view [HUAWEI] vsi company2 [HUAWEI-vsi-company2] bgp-ad [HUAWEI-vsi-company2-bgpad] vpls-id 100:1 [HUAWEI-vsi-company2-bgpad] vpn-target 3:3 export-extcommunity [HUAWEI-vsi-company2-bgpad] vpn-target 4:4 import-extcommunity [HUAWEI-vsi-company2-bgpad] vpn-target 5:5 both