peer group
Use peer group to add a peer to a peer group.
Use undo peer group to delete a peer from a peer group.
Syntax
peer { ipv6-address [ prefix-length ] } group group-name [ as-number as-number ]
undo peer { ipv4-address [ mask-length ] | ipv6-address [ prefix-length ] } group group-name
Default
No peers exist in a peer group.
Views
BGP instance view
BGP-VPN instance view
Predefined user roles
network-admin
Parameters
ipv4-address: Specifies a peer by its IPv4 address.
mask-length: Specifies a mask length in the range of 0 to 32. You can use the ipv4-address and mask-length arguments together to specify a subnet. If you specify a subnet, this command adds all dynamic peers in the subnet to a peer group.
ipv6-address: Specifies a peer by its IPv6 address.
prefix-length: Specifies a prefix length in the range of 0 to 128. You can use the ipv6-address and prefix-length arguments together to specify a subnet. If you specify a subnet, this command adds all dynamic peers in the subnet to a peer group.
group-name: Specifies a peer group by its name, a case-sensitive string of 1 to 47 characters. The peer group must have been created.
as-number as-number: Specifies an AS for a peer by its number in the range of 1 to 4294967295.
Usage guidelines
You can add a peer to a peer group in the following ways:
Use the peer as-number command to create a peer and specify its AS number, and then use the peer group command to add the peer to the peer group.
You can specify the as-number keyword for the peer group command. The AS number must be the same as the AS number specified in the peer as-number command.
If you have specified the AS number of the peer group with the peer as-number command, the peer to be added must have the same AS number as the peer group.
To add a peer to an IBGP peer group, the peer must be an IBGP peer.
Use the peer group command to create a peer and add it to the peer group.
If you have specified the AS number of the peer group with the peer as-number command, you do not need to specify the as-number keyword when you execute the peer group command. This is because the AS number of the peer is the same as the peer group. To specify the as-number keyword for the peer group command, make sure the AS number is the same as the peer group.
If no AS number is specified for an EBGP peer group, specify the as-number keyword when you execute the peer group command.
If no AS number is specified for an IBGP peer group, you do not need to specify the as-number keyword when you execute the peer group command. This is because the AS number of the IBGP peer group is the local AS number. To specify the as-number keyword for the peer group command, make sure the AS number is the same as the local AS number.
If you have specified the AS number of a peer group with the peer as-number command, only the peers with the same AS number can be added to the peer group. All peers in the group share the same AS number. If you have not specified the AS number for a peer group, peers added to it can use their own AS numbers.
After you add a peer to a peer group, you must use the peer enable command to enable BGP to exchange routing information with the peer group.
Examples
# In BGP instance view, add peer 10.1.1.1 to EBGP peer group test.
<Sysname> system-view [Sysname] bgp 100 [Sysname-bgp-default] group test external [Sysname-bgp-default] peer 10.1.1.1 group test as-number 2004
Related commands
group
peer as-number
peer enable