as-number ipv4

Function

The as-number ipv4 command configures an independent AS number for an IPv4 peer of a VPN instance.

The undo as-number ipv4 command restores the default configuration.

The as-number ipv6 command configures an independent AS number for an IPv6 peer of a VPN instance.

The undo as-number ipv6 command restores the default configuration.

By default, a VPN instance uses the AS number of BGP.

Format

as-number ipv4 ipv4-as

as-number ipv6 ipv6-as

undo as-number ipv4 ipv4-as

undo as-number ipv6 ipv6-as

Parameters

Parameter Description Value
ipv4-as

Specifies the AS number of an IPv4 peer.

The value is an integer that ranges from 1 to 4294967295.

The value is in dotted notation in the format of x.y, where x is an integer ranging from 1 to 65535 and y is an integer ranging from 0 to 65535.

ipv6-as

Specifies the AS number of an IPv6 peer.

The value is an integer that ranges from 1 to 4294967295.

The value is in dotted notation in the format of x.y, where x is an integer ranging from 1 to 65535 and y is an integer ranging from 0 to 65535.

Views

BGP-VPN instance view, BGP multi-instance VPN instance view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

If a physical device needs to be simulated as multiple logical BGP devices during network migration or service identification, you can run the as-number { ipv4 | ipv6 } command to configure an independent AS number for each VPN instance when VPN instances are managed in YANG mode.

After the command is run:

  • The peers in the VPN instance use the configured AS number to establish connections.
  • The configured AS number is used to generate the aggregator attribute during route summarization.
  • When advertising routes to an EBGP peer, the local device adds the AS number configured for the VPN instance to the routes.

Prerequisites

If a BGP peer or a BGP peer group has been configured in the VPN instance, delete the configuration of the BGP peer or peer group before configuring or deleting an AS number.

Precautions

  1. If an independent VPN instance has been configured with an AS number, no confederation can be configured for the VPN instance. A VPN instance configured with BGP confederation cannot be configured with an AS number.
  2. The independent AS number configured in the VPN instance view cannot be the same as the AS number configured in the BGP view.
  3. The AS number of the BGP VPN instance address family cannot coexist with the AS number of the BGP VPN instance.
  4. If a peer or peer group exists, the AS number of the BGP VPN instance cannot be changed.
  5. After an AS number is configured for a BGP VPN instance, the peers in the BGP VPN instance view can be enabled only in the IPv4 or IPv6 address family of the VPN instance.

Example

# Set the independent AS number of the VPN instance named vpna to 65001.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpna
[*HUAWEI-vpn-instance-vpna] route-distinguisher 1:4
[*HUAWEI-vpn-instance-vpna-af-ipv4] vpn-target 10:1
[*HUAWEI-vpn-instance-vpna-af-ipv4] quit
[*HUAWEI-vpn-instance-vpna] ipv6-family
[*HUAWEI-vpn-instance-vpna-af-ipv6] route-distinguisher 1:4
[*HUAWEI-vpn-instance-vpna-af-ipv6] vpn-target 10:1
[*HUAWEI-vpn-instance-vpna-af-ipv6] quit
[*HUAWEI-vpn-instance-vpna] quit
[*HUAWEI] bgp 100
[*HUAWEI-bgp] vpn-instance vpna
[*HUAWEI-bgp-instance-vpna] as-number ipv4 65001
[*HUAWEI-bgp-instance-vpna] as-number ipv6 65001
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >