vpn-target (EVPN)

Function

The vpn-target command configures VPN targets for an EVPN instance.

The undo vpn-target command deletes the VPN targets configured for an EVPN instance.

By default, no VPN targets are configured for an EVPN instance.

Format

vpn-target { vpn-target } &<1-8> [ vrfRtType ]

undo vpn-target { vpn-target } &<1-8> [ vrfRtType ]

undo vpn-target all

Parameters

Parameter Description Value
vpn-target

Specifies a VPN target to be configured for a VPN instance IPv4 address family.

The format of a VPN target can be as follows:

  • 2-byte AS number:4-byte user-defined number, for example, 1:3. An AS number is an integer ranging from 0 to 65535, and a user-defined number is an integer ranging from 0 to 4294967295. The AS and user-defined numbers cannot be both 0s. This means that a VPN target cannot be 0:0.
  • Integral 4-byte AS number:2-byte user-defined number, for example, 65537:3. An AS number is an integer ranging from 65536 to 4294967295, and a user-defined number is an integer ranging from 0 to 65535.
  • 4-byte AS number in dotted notation:2-byte user-defined number, for example, 0.0:3 or 0.1:0. A 4-byte AS number in dotted notation is in the format of x.y, where x and y are integers ranging from 0 to 65535. A user-defined number is an integer ranging from 0 to 65535. The AS and user-defined numbers cannot be both 0s. This means that a VPN target cannot be 0.0:0.
  • 32-bit IP address:2-byte user-defined number. For example, 192.168.122.15:1. An IP address ranges from 0.0.0.0 to 255.255.255.255, and a user-defined number is an integer ranging from 0 to 65535.
vrfRtType

Adds a VPN target to the VPN target list of a VPN instance IPv4 address family.

The value is an enumerated type:

  • both: adds a VPN target to both the import and export VPN target lists of a VPN instance IPv4 address family. If both, export-extcommunity, and import-extcommunity are not configured in the vpn-target command, a VPN target is added to both lists by default.
  • export-extcommunity: adds a VPN target to the export VPN target list of a VPN instance IPv4 address family.
  • import-extcommunity: adds a VPN target to the import VPN target list of a VPN instance IPv4 address family.
all

Deletes all the VPN targets of a VPN instance IPv4 address family.

-

Views

B-EVPN instance view, BD EVPN view, EVPN instance view, VPWS-EVPN instance view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

When a PE advertises EVPN routes to other PEs, the PE attaches all the local export VPN targets to these routes. After a PE receives EVPN routes, the PE matches export VPN targets carried in these routes against the local import VPN target list and imports these routes to the local EVPN instance routing table only if at least one export VPN target matches one import VPN target.

One vpn-target command configures a maximum of eight VPN targets. To configure more VPN targets, run the vpn-target command several times.

Prerequisites

An RD has been configured for the EVPN instance using the route-distinguisher command.

Configuration Impact

If you do not configure this command, a PE cannot import received EVPN routes to its local EVPN instance routing table.

After all the VPN targets of an EVPN instance are deleted using the undo vpn-target command, all EVPN routes learned by the EVPN instance from other EVPN instances will be deleted.

Example

# Configure both the import and export VPN targets as 5:5 for an EVPN instance.
<HUAWEI> system-view
[~HUAWEI] evpn vpn-instance evpn1
[*HUAWEI-evpn-instance-evpn1] route-distinguisher 22:1
[*HUAWEI-evpn-instance-evpn1] vpn-target 5:5 both
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >