The vpn-target command configures the export or import VPN target extended community attribute for an EVPN instance address family.
The undo vpn-target command deletes the VPN target extended community attribute for the EVPN instance address family.
By default, no export or import VPN target extended community attribute list is configured for the EVPN instance address family.
vpn-target vpn-target &<1-8> [ both | export-extcommunity | import-extcommunity ]
undo vpn-target { all | vpn-target &<1-8> [ both | export-extcommunity | import-extcommunity ] }
Parameter | Description | Value |
---|---|---|
vpn-target | Adds a VPN target to the VPN target extended community attribute list of the EVPN instance address family. The forms of VPN targets are as follows:
|
- |
both | Adds a VPN target to the import or export VPN target extended community attribute list of the EVPN instance address family. If keywords both, export-extcommunity, and import-extcommunity are not specified, both is used by default. | - |
export-extcommunity | Adds a VPN target to the export VPN target extended community attribute list of the EVPN instance address family. | - |
import-extcommunity | Adds a VPN target to the import VPN target extended community attribute list of the EVPN instance address family. | - |
all | Deletes all the VPN targets of the EVPN instance address family. | - |
Usage Scenario
When a local device advertises EVPN routes to other devices, the EVPN routes carry all VPN target attributes in the export VPN target attribute list of the local EVPN instance. Only when the VPN target attribute carried in an EVPN route is included in the import VPN target attribute list, the route can be added to the EVPN instance routing table.
You can run the vpn-target command to add VPN targets to the VPN target extended community attribute list of an EVPN instance through more than one time. A maximum of eight VPN targets can be added at one time. To configure more VPN targets for an EVPN instance, you can run the vpn-target command multiple times.
Prerequisites
The RD of the EVPN instance has been configured by running the route-distinguisher command.
Precautions
If this command is not run, all received EVPN routes cannot be added to the local EVPN instance routing table.
If all the VPN targets of an EVPN instance are deleted using the undo vpn-target command, all routes learned by the EVPN instance are deleted.
# Add 3:3 to the export VPN target extended community attribute list and 4:4 to the import VPN target extended community attribute list of EVPN instance evn3.
<HUAWEI> system-view [HUAWEI] evpn vpn-instance evn3 bd-mode [HUAWEI-evpn-instance-evn3] route-distinguisher 100:1 [HUAWEI-evpn-instance-evn3] vpn-target 3:3 export-extcommunity [HUAWEI-evpn-instance-evn3] vpn-target 4:4 import-extcommunity