Configuration Condition
Before configuring BGP network optimization, ensure that:
- BGP is enabled.
- BGP neighbors are configured and a session is set up successfully.
Configure the Keep-alive Time of BGP Neighbors
After a BGP session is successfully set up, keep-alive messages are sent periodically between the neighbors to maintain the BGP session. If no keep-alive message or Update packet is received from the neighbor within the hold time, the BGP session will be disconnected owing to timeout. The keep-alive time is equal to or smaller than 1/3 of the hold time.
Table 12-34 Configure the keep-alive time of BGP neighbors
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure global BGP keep-alive time and hold time.
|
timers bgp keepalive-interval holdtime-interval
|
Optional.
By default, the keepalive timer is 60s, the hold timer is 180s, and the session re-connection timer is 120s.
|
Configure the keepalive time and hold time of a BGP neighbor or peer group.
|
neighbor { neighbor-address | peer-group-name } timers { keepalive-interval holdtime-interval | connect connect-interval }
|
- The keepalive time and hold time that are set for a specified neighbor have higher priorities than the global BGP keepalive time and hold time.
- Neighbors negotiate and then take the minimum hold time as the hold of the BGP session between the neighbors.
- If the keepalive time and hold time are both set to 0, the neighbor keepalive/hold function is canceled.
- If the keepalive time is longer than 1/3 of the hold time, the BGP session sends keepalive packets at the interval of 1/3 the hold time.
Configure BGP Route Detection Time
BGP mainly aims at implementing a routing process, with ASs as the routing units. Within an AS, IGP is used for routing. Therefore, BGP routes often rely on IGP routes. If the next hops or output interfaces of IGP routes that BGP relies on change, BGP detects IGP routes periodically to update BGP routes. BGP also update local BGP routes during the detection interval.
Table 12-35 Configure BGP route detection time
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure BGP route detection time.
|
bgp scan-time time
|
Optional.
By default, the BGP route detection time is 60s.
|
-
If the BGP route detection time is set too small, BGP detect routes frequently, affecting the device performance.
Configure Quick Disconnection of EBGP Neighbors
After a BGP session is successfully set up, Keepalive messages are sent periodically between the neighbors to maintain the BGP session. If no Keepalive message or Update packet is received from the neighbor within the hold time, the BGP session will be disconnected owing to timeout. You can configure direct-connect EBGP neighbors to disconnect a BGP connection immediately after a connecting interface is down, without waiting for BGP keepalive timeout. If the EBGP neighbor quick disconnection function is cancelled, the EBGP session does not respond to an interface down event; instead, the BGP session is disconnected after timeout.
Table 12-36 Configure quick disconnection of EBGP neighbors
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure quick disconnection of EBGP neighbors.
|
bgp fast-external-failover
|
Optional.
By default, EBGP's quick processing capability in responding to the direct-connect interface down event is enabled.
|
Configure the BGP Route Suppression Function
Flapping routes in a network may cause instability of the network. You can configure route attenuation to damp this type of routes so as to decrease the effect of flapping routes on the network.
A frequently flapping route will be allocated with a penalty. If the penalty exceeds the suppression threshold, the route will not be advertised to neighbors. The penalty should not be kept beyond the maximum suppression time. If no flapping occurs on the route within the half-life period, the penalty will be halved. If the penalty is lower than the threshold value, the route can be advertised to neighbors again.
- Half-life period: It is the time in which the penalty of a route is halved.
- Reuse threshold: It is the threshold for the route to resume normal use.
- Suppression threshold: It is the threshold for route suppression.
- Maximum suppression time: It is the maximum suppression time of the route.
Table 12-37 Configure the BGP route suppression function
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Configure the BGP route attenuation period.
|
bgp dampening [ reach-half-life [ reuse-value suppress-value max-suppress-time [ unreach-half-life ] ] | route-map rtmap-name ]
|
Mandatory.
By default, the route suppression function is disabled. After the function is enabled, the default route suppression half-life period is 15 minutes, the route reuse threshold is 750 seconds, the route suppression threshold is 2000 seconds, the maximum route suppression time is 60 minutes, and the route penalty unreachable half-life period is 15 minutes.
|
-
Route flapping not only contains addition and deletion of routes, but also contains route property changes such as next hop and MED property changes.
Configure the BGP Neighbor Refresh Capability
If the routing policy or route selection policy that is applied to a BGP neighbor changes, the routing table needs to be refreshed. One way of refreshing the routing table is to reset the BGP connection so as to reset the BGP session. However, this mode may result in BGP route flapping, affecting normal services. The other way is more graceful, that is, configuring the local BGP device to support the route refresh capability. If a neighbor needs to reset a route, it advertises the Route-Refresh message to the local device. After receiving the Route-Refresh message, it sends the route to the neighbor again. In this way, the routing table is dynamically refreshed without the need of disconnecting the BGP session.
Table 12-38 Configure the BGP Neighbor refresh capability
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enable the BGP neighbor refresh capability.
|
neighbor { neighbor-address | peer-group-name } capability route-refresh
|
Optional.
By default, the BGP neighbor refresh capability is enabled.
|
Configure the BGP Neighbor Soft Reset Capability
If the routing policy or route selection policy that is applied to a BGP neighbor changes, the routing table needs to be refreshed. One way of refreshing the routing table is to reset the BGP connection so as to reset the BGP session. However, this mode may result in BGP route flapping, affecting normal services. Another way is more graceful, that is, configuring the local BGP device to support the route refresh capability. There is still another way, that is, enabling the soft reset capability of the local BGP device. By default, the BGP device reserves the routing information of each neighbor. After enabling its neighbor soft reset capability, it refreshes the neighbor routes that are kept on the local device. At this time, BGP sessions are not disconnected.
Table 12-39 Configure the BGP neighbor soft reset capability
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Enable the BGP neighbor soft reset capability.
|
neighbor { neighbor-address | peer-group-name } soft-reconfiguration inbound
|
Mandatory.
By default, the neighbor soft reset function is disabled.
|
Configure the ORF Capability of BGP Neighbors
BGP implements accurate route control through abundant routing properties. It usually applies routing policies in the incoming and outgoing directions. This mode is a local BGP behavior. BGP also supports the Outbound Route Filtering (ORF) capability. It advertises the local ingress policy to its neighbors through Route-refresh packets, and then the neighbors apply the policy when they advertise routes to the local BGP device. This greatly decreases the number of exchanged route refresh packets between BGP neighbors.
To achieve successful negotiation of the ORF capability, ensure that:
- The ORF capability is enabled for both neighbors.
- "ORF send" and "ORF receive" must match. That is, if one end is "ORF send", the other end must be "ORF both" or "ORF receive". If one end is "ORF receive", the other end must be "ORF send" or "ORF both".
- The "ORF send" end must be configured with a prefix list in the incoming direction.
Table 12-40 Configure the ORF capability of BGP neighbors
Step
|
Command
|
Description
|
Enter the global configuration mode.
|
configure terminal
|
-
|
Enter the BGP configuration mode.
|
router bgp autonomous-system
|
-
|
Apply a prefix list in the incoming direction of a neighbor.
|
neighbor { neighbor-address | peer-group-name } prefix-list prefix-list-name in
|
Mandatory.
By default, no prefix list is applied to any BGP neighbor.
|
Configure a neighbor to support the ORF capability.
|
neighbor { neighbor-address | peer-group-name } capability orf prefix-list { both | receive | send }
|
Mandatory.
By default, a neighbor does not support the ORF capability.
|