peer public-as-only (BGP-IPv4 multicast address family view) (group)

Function

The peer public-as-only command configures an MBGP device to remove all private AS numbers from the AS_Path attribute in an MBGP Update packet to be sent.

The undo peer public-as-only command cancels the configuration.

By default, the AS-Path in an MBGP Update packet is allowed to carry private AS numbers.

Format

peer peerGroupName public-as-only

peer peerGroupName public-as-only force [ replace ] [ include-peer-as ]

peer peerGroupName public-as-only limited [ replace ] [ include-peer-as ]

undo peer peerGroupName public-as-only

undo peer peerGroupName public-as-only force [ replace ] [ include-peer-as ]

undo peer peerGroupName public-as-only limited [ replace ] [ include-peer-as ]

Parameters

Parameter Description Value
peerGroupName

Specifies the name of an MBGP peer group.

The value is a string of 1 to 47 case-sensitive characters, spaces not supported.

force

Deletes all private AS numbers from the AS_Path attribute except the private AS number of a specified peer or peer group.

-

replace

Replaces the private AS numbers in the AS_Path attribute with the local AS number except the private AS number of a specified peer or peer group.

-

include-peer-as

Indicates that no skip MBGP peer AS number.

-

limited

Deletes private AS numbers from the leftmost one to the local or a public AS number except the private AS number of a specified peer or peer group.

-

Views

BGP-IPv4 multicast address family view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

Generally, AS numbers range from 1 to 4294967295, including the public, private, and reserved AS numbers. If the private-4-byte-as enable command is not run, private AS numbers range from 64512 to 65534, and the AS number 65535 is reserved for special use. If the private-4-byte-as enable command is run, private AS numbers range from 64512 to 65534 and from 4200000000 to 4294967294, and the AS numbers 65535 and 4294967295 are reserved for special use.

Public AS numbers can be used over the Internet, whereas private AS numbers cannot be advertised to the Internet. If private AS numbers are advertised to the Internet, routing loops may occur. Therefore, private AS numbers are used only within a routing domain.

This command enables BGP to process the private and reserved AS numbers in the AS_Path attribute of BGP routes as required. Reserved AS numbers are processed the same as private AS numbers. The following uses private AS numbers as an example to illustrate the processing modes:

If the peer public-as-only command is run without any optional parameter specified and the AS_Path attribute of BGP routes contains only private AS numbers, BGP deletes these private AS numbers before advertising the routes. BGP does not delete private AS numbers in either of the following scenarios if the peer public-as-only command is run, without any parameter following public-as-only specified:

• The AS_Path attribute of a route carries the AS number of the remote peer. In this case, deleting private AS numbers may lead to a routing loop.

• The AS_Path attribute carries both public and private AS numbers, which indicates that the route has passed through the public network. In this case, deleting private AS numbers may lead to a traffic forwarding error.

Parameters that are used to delete or replace private AS numbers are described as follows:

• force: deletes all private AS numbers from the AS_Path attribute except the private AS number of a specified peer group.

• force replace: replaces the private AS numbers in the AS_Path attribute with the local AS number except the private AS number of a specified peer group.

• force include-peer-as: deletes all private AS numbers from the AS_Path attribute.

• force replace include-peer-as: replaces the private AS numbers in the AS_Path attribute with the local AS number. This parameter ensures that the AS_Path attribute length remains unchanged. Therefore, the route selection result is not affected.

• limited: deletes private AS numbers from the leftmost one to the local or a public AS number except the private AS number of a specified peer group.

• limited replace: replaces private AS numbers from the leftmost one to the local or a public AS number in the AS_Path attribute with the local AS number except the private AS number of a specified peer group.

• limited include-peer-as: deletes private AS numbers from the leftmost one to the local or a public AS number. This parameter ensures that all private AS numbers of the local network are deleted.

• limited replace include-peer-as: replaces private AS numbers from the leftmost one to the local or a public AS number in the AS_Path attribute with the local AS number.

Select one of the preceding parameters based on the network topology to prevent routing loops or forwarding errors.

Precautions

Select one of the preceding parameters based on the network topology to prevent routing loops or forwarding errors.

Example

# Configure an MBGP device to remove all private AS numbers from the AS_Path attribute of an Update packet to be sent to a peer group named test.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[*HUAWEI-bgp] group test internal
[*HUAWEI-bgp] ipv4-family multicast
[*HUAWEI-bgp-af-multicast] peer test enable
[*HUAWEI-bgp-af-multicast] peer test public-as-only
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >