Configuring the Dynamic BGP Peer Function
Usage Scenario
If static BGP peers change frequently, the local device needs to add or delete BGP peer configurations in response to each change, which requires a heavy maintenance workload. To address this problem, configure the dynamic BGP peer function, which allows BGP to listen to BGP connection requests from a specified network segment, establish BGP peer relationships dynamically, and add the peers to a peer group. This spares the local device from adding or deleting BGP peer configurations in response to each change in the peer number, which reduces the maintenance workload.
Pre-configuration Tasks
Before configuring the dynamic BGP peer function, configure basic BGP functions.
Procedure
- Run system-view
The system view is displayed.
- Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
- (Optional) Run bgp dynamic-session-limit limit-value
The maximum number of dynamic BGP peer sessions is configured.
If a large number of dynamic BGP peer sessions are established on the network segment, excessive system resources will be consumed. To prevent this problem, configure a maximum number for dynamic BGP peer sessions as required.
By default, the maximum number of dynamic BGP peer sessions is half of the total specification.
- (Optional) Run ipv4-family vpn-instance vpn-instance-name
The BGP-VPN instance IPv4 address family view is displayed.
Perform this step if you need to configure the dynamic BGP peer function in the BGP-VPN instance IPv4 address family view in a BGP/MPLS IP VPN scenario.
- Run group group-name [ external | internal ]
A BGP peer group is created.
Configure the following parameters as required:
-
If the local device and its peers reside in the same AS, configure internal to create an IBGP peer group.
-
If the local device and its peers reside in different ASs, configure external to create an EBGP peer group.
If neither internal nor external is configured, an IBGP peer group is created by default.
-
- Run peer group-name listen-net network { mask | mask-length }
BGP is configured to listen to BGP connection requests from a specified network segment and establish BGP peer relationships dynamically.
If you run the command multiple times, BGP listens to BGP connection requests from multiple network segments.
- Run peer group-name as-number { as-number-plain | as-number-dot } [ optional-as { optional-as-number-plain | optional-as-number-dot } &<1-5> ]
An AS number is configured for the peer group.
Configure the following parameters as required:
-
If the dynamic peers in the peer group reside in the same AS, configure { as-number-plain | as-number-dot } to set a fixed AS number.
-
If the dynamic peers in the peer group may reside in different ASs, in addition to a fixed AS number, you need to configure optional-as { optional-as-number-plain | optional-as-number-dot } &<1-5> to set an optional AS number. A maximum of five optional AS numbers can be set.
-
Verifying the Configuration
- Run the display bgp [ vpnv4 { all | vpn-instance vpn-instance-name } ] peer [ [ ipv4-address ] verbose ] command to check BGP peer information.
- Run the display bgp [ vpnv4 { all | vpn-instance vpn-instance-name } ] group [ group-name ] command to check BGP peer group information.
# Display BGP peer information. The command output shows dynamic peer information.
<Huawei> display bgp peer
Status codes: * - Dynamic BGP local router ID : 1.2.3.4 Local AS number : 10 Total number of peers : 2 Peers in established state : 1 Total number of dynamic peers : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 1.1.1.1 4 100 0 0 0 00:00:07 Idle 0 *1.2.5.6 4 200 32 35 0 00:17:49 Established 0
# Display BGP peer group information. The command output shows dynamic peer information and the network segment from which BGP listens to BGP connection requests.
<Huawei> display bgp group my-peer
BGP peer-group: my-peer
Remote AS: 100
listen-net: 10.1.1.0 24
Authentication type configured: None
Group's BFD has been enabled
Type : internal
Maximum allowed route limit: 100
Threshold: 75%
Configured hold timer value: 180
Keepalive timer value: 60
Connect-retry timer value: 32
Minimum route advertisement interval is 15 seconds
PeerSession Members:
10.1.1.2
Status codes: * - Dynamic
Peer Preferred Value: 0
No routing policy is configured
Peer Members:
Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv
*10.1.1.2 4 100 35 42 0 00:29:01 Established 0