The peer group command adds a peer to a peer group.
The undo peer group command deletes a peer from a peer group and all configurations of the peer.
By default, no peer is in peer group.
peer { ipv4-address | ipv6-address } group group-name
undo peer { ipv4-address | ipv6-address } group group-name
Parameter | Description | Value |
---|---|---|
ipv4-address |
Specifies the IPv4 address of a peer. |
It is in dotted decimal notation. |
ipv6-address |
Specifies the IPv6 address of a peer. |
The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
group-name |
Specifies the name of a peer group. |
The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
ipv4-address is valid only in the BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPNv6 address family view, BGP-VPLS address family view, BGP-L2VPN address family view, BGP L2VPN-AD address family view, and BGP-EVPN address family view.
ipv6-address is valid only in the BGP view, BGP-IPv6 unicast address family view, and BGP-VPN instance IPv6 address family view.
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv6 address family view, BGP-VPLS address family view, BGP-L2VPN address family view, BGP L2VPN-AD address family view, BGP-EVPN address family view
Usage Scenario
On a large-scale BGP network, there are a large number of peers and many of them have the same routing policies. To configure these peers, you have to repeatedly use some commands. In such a case, configuring peer groups can simplify configurations. If you intend to perform the same configuration on several peers, create and configure a peer group. Then, add the peers to the peer group. The peers will inherit the configurations of the peer group.
Precautions
Peers with different AS numbers can be added to the same peer group. If a peer has an AS number, the peer keeps its own AS number after being added to a peer group. If a peer has no AS number but the peer group to which the peer will be added has an AS number, the peer inherits the AS number of the peer group after being added to the peer group.
The members of a peer group can be configured with different route receiving and advertising policies.
The undo peer group command has the same function with the undo peer command and the undo peer enable command.
By default, only the IPv4 peers configured in the BGP-IPv4 unicast address family view are automatically added to a peer group. That is, after the peer ipv4-address group group-name command is configured in the BGP view, the system configures the peer ipv4-address group group-name command in the BGP-IPv4 unicast address family view. In other address family views, peers must be manually added to a peer group.
# Create an IBGP peer group named test, and then add a peer to it.
<HUAWEI> system-view [HUAWEI] bgp 100 [HUAWEI-bgp] group test internal [HUAWEI-bgp] peer 10.1.1.1 group test
# Create an EBGP peer group named test and add an IPv6 peer to this peer group.
<HUAWEI> system-view [HUAWEI] bgp 100 [HUAWEI-bgp] group test external [HUAWEI-bgp] peer 1:2::3:4 as-number 200 [HUAWEI-bgp] peer 1:2::3:4 group test [HUAWEI-bgp] ipv6-family unicast [HUAWEI-bgp-af-ipv6] peer test enable [HUAWEI-bgp-af-ipv6] peer 1:2::3:4 group test