The vpn-target command associates a VSI with one or more VPN targets.
The undo vpn-target command deletes a VPN target associated with a VSI.
By default, a VSI is not associated with any VPN target.
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 |
Specifies a VPN target that is added to a VSI. |
You can choose one of the following formats to express a
VPN target:
|
export-extcommunity |
Indicates the extended community attributes carried in the data to be sent. |
- |
import-extcommunity |
Indicates the extended community attributes carried in the received data. |
- |
both |
Indicates the import routing information from the extended community of the destination VPN and the export routing information sent to the extended community of the destination VPN. |
- |
all |
Deletes all attributes of VPN targets. |
- |
Usage Scenario
When sending routing information to other PE devices according to the VSI, a PE device adds export VPN targets to the routing information. When receiving routing information from other PE devices, the PE determines whether to add the data to the VSI according to import VPN targets. Therefore, VPN targets can be used to control the route advertisement between nodes.
Prerequisites
The RD of the VSI has been configured using the route-distinguisher route-distinguisher command.
# Associate the current VSI with a VPN target.
<HUAWEI> system-view [HUAWEI] vsi company2 [HUAWEI-vsi-company2] pwsignal bgp [HUAWEI-vsi-company2-bgp] route-distinguisher 2.2.2.2:1 [HUAWEI-vsi-company2-bgp] vpn-target 3:3 export-extcommunity [HUAWEI-vsi-company2-bgp] vpn-target 4:4 import-extcommunity [HUAWEI-vsi-company2-bgp] vpn-target 5:5 both