< Home

vpn-target evpn

Function

The vpn-target evpn command configures the export or import VPN target extended community attribute when a VPN instance address family advertises routes to an EVPN instance.

The undo vpn-target command deletes the VPN target extended community attribute from a VPN instance address family.

By default, no export or import VPN target extended community attribute list is configured for a VPN instance address family.

Format

vpn-target vpn-target &<1-8> [ both | export-extcommunity | import-extcommunity ] evpn

undo vpn-target { all | vpn-target &<1-8> [ both | export-extcommunity | import-extcommunity ] [ evpn ] }

Parameters

Parameter Description Value
vpn-target Adds a VPN target to the VPN target extended community attribute list of the VPN instance address family. The forms of VPN targets are as follows:
  • 2-byte AS number: 4-byte user-defined number, for example, 1:3. The AS number ranges from 0 to 65535, and the user-defined number ranges from 0 to 4294967295. The AS number and user-defined number cannot be both 0s. That is, a VPN target cannot be 0:0.

  • IPv4 address: 2-byte user-defined number, for example, 192.168.122.15:1. The IP address ranges from 0.0.0.0 to 255.255.255.255, and the user-defined number ranges from 0 to 65535.

  • Integral 4-byte AS number: 2-byte user-defined number, for example, 65537:3. The AS number ranges from 65536 to 4294967295, and the user-defined number ranges from 0 to 65535. The AS number and user-defined number cannot be both 0s. That is, a VPN target cannot be 0:0.

  • 4-byte AS number in dotted notation: 2-byte user-defined number, for example, 0.0:3 or 0.1:0. The 4-byte AS number in dotted notation is in the format of x.y, where x and y are integers that range from 0 to 65535, and the user-defined number ranges from 0 to 65535. The AS number and user-defined number cannot be both 0s. That is, a VPN target cannot be 0:0.0.

-
both Adds a VPN target to the import or export VPN target extended community attribute list of the VPN instance address family. If keywords both, export-extcommunity,and import-extcommunityare not specified, both is used. -
export-extcommunity Adds a VPN target to the export VPN target extended community attribute list of the VPN instance address family. -
import-extcommunity Adds a VPN target to the import VPN target extended community attribute list of the VPN instance address family. -
evpn Specifies a VPN target for determining whether a route can be added to the routing table of an EVPN instance. -
all Deletes all the VPN targets of the VPN instance address family. -

Views

VPN instance view, VPN instance IPv4 address family view, VPN instance IPv6 address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When you configure a VPN instance on a device, you must run the vpn-target evpn command to configure a VPN target attribute of EVPN routes for the address family of the VPN instance.

The VPN target controls route learning of EVPN routes. A VPN target attribute is either an import one or an export one. An export VPN target is carried in a EVPN route to be advertised to a remote MP-BGP peer. When receiving a EVPN route, a peer compares the received VPN target attribute with the import VPN target attribute to determine whether the EVPN route can be added to the routing table of the local VPN instance address family.

In the VXLAN deployed through BGP EVPN scenario, to add EVPN routes to the routing table of an VPN instance, run the vpn-target command to configure the corresponding VPN target.

Prerequisites

The route-distinguisher command have been run to configure the VPN instance RD.

Precautions

A VPN target configured using the vpn-target evpn command will not overwrite any previously configured VPN target. If the number of configured VPN targets has reached the maximum limit, no VPN target can be added by running the vpn-target evpn command.

After a VPN target is configured for the address family of a VPN instance, only the routes that match the VPN target are accepted by the address family of the VPN instance.

If all the VPN targets of the address family of a VPN instance are deleted using the undo vpn-target evpn command, all EVPN routes learned by the address family of the VPN instance from other VPN instances are deleted.

Multiple VPN targets can be configured for the address family of a VPN instance. The vpn-target evpn command can configure a maximum of eight VPN targets at a time. To configure more VPN targets in the VPN instance view, run the vpn-target evpn command multiple times. When EVPN routes are advertised between VPN instances, if one of the VPN targets carried in the EVPN routes matches the import VPN target of the address family of a local VPN instance, the routes are added to the routing table of the local VPN instance.

Example

# Add 3:3 to the export VPN target EVPN list and 4:4 to the import VPN target evpn list of VPN instance vrf1.

<HUAWEI> system-view
[HUAWEI] ip vpn-instance vrf1
[HUAWEI-vpn-instance-vrf1] ipv4-family
[HUAWEI-vpn-instance-vrf1-af-ipv4] route-distinguisher 100:1
[HUAWEI-vpn-instance-vrf1-af-ipv4] vpn-target 3:3 export-extcommunity evpn
[HUAWEI-vpn-instance-vrf1-af-ipv4] vpn-target 4:4 import-extcommunity evpn
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >