vpn-target (VSI-BGP-MH view)

Function

The vpn-target command associates a VSI with one or more VPN targets.

The undo vpn-target command restores the default configuration.

By default, a VSI is not associated with any VPN targets.

Format

vpn-target { vpnTargetValue } &<1-16> [ both | import-extcommunity | export-extcommunity ]

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

Parameters

Parameter Description Value
vpnTargetValue

Specifies a VPN target.

The available VPN target formats are as follows:

  • 2-byte AS number:4-byte user-defined number, such as 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. Specifically, a VPN target cannot be 0:0.
  • 4-byte IP address:2-byte user-defined number, such as 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.
  • 4-byte AS number:2-byte user-defined number, such as 65537:3. The AS number ranges from 65536 to 4294967295, and the user-defined number ranges from 0 to 65535.
  • 4-byte AS number in dotted notation:2-byte user-defined number, such as 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. The user-defined number also ranges from 0 to 65535. The AS number and user-defined number cannot be both 0s. Specifically, a VPN target cannot be 0.0:0.
both

Indicates the VPN target carried by both incoming and outgoing routes.

-

import-extcommunity

Indicates the VPN target carried by incoming routes.

-

export-extcommunity

Indicates the VPN target carried by outgoing routes.

-

all

Deletes all VPN targets.

-

Views

VSI-BGP-MH view, VSI-BGP view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
l2vpn write

Usage Guidelines

Usage Scenario

VPN targets are used on a BGP VPLS network to control route advertisement and communication between nodes:

  • A PE adds export VPN targets to routes to be advertised to other PEs.
  • After a PE receives routes from other PEs, it determines whether to import the received routes to local VSIs by comparing the export VPN targets of these routes with the local import VPN targets.

Prerequisites

The VSI-BGP view has been displayed using the pwsignal bgp command.

Configuration Impact

In a BGP VPLS domain, two PEs can communicate only if the import VPN target of one PE is the same as the export VPN target of the other PE.

Precautions

In a BGP VPLS domain, a PW can be established between two PEs only if the import VPN target of one PE is the same as the export VPN target of the other PE.

Example

# Create a VSI named vsi1, and configure its import and export VPN targets as 100:100 and 200:200, respectively.
<HUAWEI> system-view
[~HUAWEI] mpls
[*HUAWEI-mpls] quit
[*HUAWEI] mpls l2vpn
[*HUAWEI-l2vpn] quit
[*HUAWEI] vsi vsi1 auto
[*HUAWEI-vsi-vsi1] pwsignal bgp
[*HUAWEI-vsi-vsi1-bgp] route-distinguisher 1:1
[*HUAWEI-vsi-vsi1-bgp] vpn-target 100:100 import-extcommunity
[*HUAWEI-vsi-vsi1-bgp] vpn-target 200:200 export-extcommunity
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >