The peer as-number command specifies an AS number for a peer or peer group.
The undo peer as-number command deletes the AS number for a peer or peer group.
By default, no peer or peer group is configured.
peer { group-name | ipv4-address | ipv6-address } as-number { as-number-plain | as-number-dot }
undo peer group-name as-number
undo peer { ipv4-address | ipv6-address }
| Parameter | Description | Value |
|---|---|---|
| group-name | Specifies the name of the peer group. | The name is a string of 1 to 47 characters without any space. It is case-sensitive. |
| ipv4-address | Specifies the IPv4 address of the peer. | It is in dotted decimal notation. |
| ipv6-address | Specifies the IPv6 address of the peer. | The prefix is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
| as-number-plain | Specifies the integral AS number. | The value is an integer ranging from 1 to 4294967295. |
| as-number-dot | Specifies the AS number in dotted notation. | The value 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. |
ipv4-address is valid only in the BGP view and BGP-VPN instance IPv4 address family view.
ipv6-address is valid only in the BGP view and BGP-VPN instance IPv6 address family view.
BGP view, BGP-VPN instance IPv4 address family view, BGP-VPN instance IPv6 address family view
Usage Scenario
The peer as-number command is used to specify an AS number for a peer during the establishment of a BGP peer relationship. After BGP peer relationship is established, the BGP device and its peer can exchange BGP routing information.
Precautions
If a peer does not join any peer group or the peer group to which a peer belongs is not configured with an AS number, deleting the AS number of the peer will reset the peer relationship.
If a peer in a peer group is not configured with an AS number, deleting the AS number of the peer group will interrupt the connection on the peer.
The AS number for external session group cannot be the same as the local AS number.
# Specify the peer AS number for BGP peer 1.1.1.1 as 100.
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] peer 1.1.1.1 as-number 100
# Specify peer AS number for the IPv6 peer 1::1 as 100.
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] peer 1::1 as-number 100
# Specify peer AS number for the specified peer group test as 100.
<sysname> system-view
[sysname] bgp 100
[sysname-bgp] peer test as-number 100