(Optional) Configuring a BGP Peer Group
Context
A large BGP network has a large number of peers. It is difficult to configure and maintain these peers. You can add the BGP peers with the same configurations to a BGP peer group and then configure the BGP peers in batches. This simplifies peer management and improves route advertisement efficiency.
- If a function is configured on a peer and its peer group, the function configured on the peer takes precedence over that configured on the peer group.
When loopback interface or Layer 3 sub-interface addresses are used to establish a BGP connection, you are advised to perform step 6 on both ends of the BGP connection simultaneously to ensure the correct establishment of the connection. If step 6 is performed on only one end, the BGP connection may fail to be established.
When loopback interfaces are used to establish an EBGP connection, step 7 is required and hop-count in the peer ebgp-max-hop command must be greater than or equal to 2. Otherwise, the EBGP connection cannot be established.
Procedure
- Run system-view
The system view is displayed.
- Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
- Run group group-name [ external | internal ]
A BGP peer group is created.
The AS number of an IBGP peer group is the local AS number. Therefore, step 4 is not required.
- Run peer group-name as-number as-number
An AS number is configured for the EBGP peer group.
To add an EBGP peer to a peer group, configure the EBGP peer according to Configuring BGP Peers and then perform step 5.
To add an IBGP peer to a peer group, perform step 5. The system creates an IBGP peer in the BGP view and sets its AS number as the AS number of the peer group.
- Run peer { ipv4-address | ipv6-address } group group-name
A peer is added to the peer group.
You can repeat step 5 to add multiple peers to a peer group.
- (Optional) Run peer group-name connect-interface interface-type interface-number [ ipv4-source-address ]
Or run peer group-name connect-interface interface-type interface-number [ ipv6-source-address ]
A source interface and a source IP address are specified for the peer to establish a TCP connection.
By default, the outbound interface of a BGP packet serves as the source interface of the BGP packet.
- (Optional) Run peer group-name ebgp-max-hop [ hop-count ]
The maximum number of hops allowed for the establishment of an EBGP connection is set.
By default, the maximum number of hops allowed for an EBGP connection is 1. That is, an EBGP connection must be established on a directly connected physical link.
- (Optional) Run peer group-name description description-text
The description is configured for the peer group.
If a BGP peer group is configured on an IPv4 unicast network, steps 9 and 10 are not required. If a BGP peer group is configured on an IPv4 multicast network and an IPv6 unicast network, steps 9 and 10 are required.
- (Optional) Run the following commands as required.
- Run ipv4-family multicast
The BGP-IPv4 multicast address family view is displayed.
- Run ipv6-family [ unicast ]
The BGP-IPv6 unicast address family view is displayed.
- Run ipv4-family multicast
- Run peer group-name enable
MP-BGP is enabled on the BGP peers to configure them as MP-BGP peers.
- Run commit
The configuration is committed.