< Home

vpn-target (VSI-BGP view)

Function

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.

Format

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

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

Parameters

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:
  • 16-bit AS number: a 32-bit user-defined number, for example, 1:3. The AS number ranges from 0 to 65535. The user-defined number ranges from 0 to 4294967295. The AS number and the user-defined number cannot both be 0. That is, a VPN target cannot be 0:0.

  • 32-bit IP address: a 16-bit user-defined number, for example, 192.168.122.15:1. The IP address ranges from 0.0.0.0 to 255.255.255.255. The user-defined number ranges from 0 to 65535.

  • Integral 4-byte AS number:2-byte user-defined number, for example, 65537:3. An AS number ranges from 65536 to 4294967295. A 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. A 4-byte AS number in dotted notation is in the format of x.y, where x and y are integers that range from 1 to 65535 and from 0 to 65535, respectively. A 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.

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.

-

Views

VSI-BGP view

Default Level

2: Configuration level

Usage Guidelines

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.

Example

# 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >