BGP maximum-prefix and discard extra paths
BGP maximum-prefix is a BGP functionality that enforces a limit on the number of prefixes received from a neighbor for a specific address family and terminates the BGP session if the prefix count exceeds the configured limit.
The discard extra paths option is an enhancement to the BGP maximum-prefix functionality that drops excess prefixes received from a neighbor without flapping the session and limits the memory footprint of BGP.
BGP maximum-prefix overview
The BGP maximum-prefix capability allows you to configure an upper threshold on the number of prefixes that can be accepted from a neighbor for a particular address family. If the number of received prefixes exceeds the configured limit, the system performs these actions:
-
Terminates the BGP session and sends a cease notification to the neighbor.
-
Keeps the session down until you manually clear it using the clear bgp command.
-
Restarts the session automatically after a specified period if configured with the maximum-prefix command and the restart keyword.
Starting with IOS-XR Release 7.3.1, the system no longer applies default limits unless you explicitly configure the maximum number of prefixes for the address family.
Discard extra paths behavior
The discard extra paths option modifies BGP maximum-prefixbehavior. With discard extra paths option configured, when excess prefixes are received, they are dropped, but the BGP session remains stable. If the discard extra paths configuration is removed, BGP sends a route-refresh message to the neighbor if it supports the refresh capability; otherwise, the session flaps.
Effects of changing the maximum-prefix value
Changing the maximum-prefix value triggers these specific actions:
-
If the new value exceeds the current prefix count, the additional prefixes are saved.
-
If the new value is less than the current prefix count, some prefixes are deleted to align with the new limit. There is no control over which prefixes are removed.
Benefits of BGP maximum-prefix and discard extra paths
BGP maximum-prefix and discard extra paths functionality provides these benefits:
-
Limits the memory usage of BGP by dropping excess prefixes received beyond the configured maximum.
-
Prevents session flapping, ensuring stability of the BGP peer even when the prefix limit is exceeded.
-
Helps maintain operational continuity by avoiding disruptions caused by exceeding the prefix limit.
Limitations of discard extra paths
When configuring discard extra paths, consider these guidelines.
The discard extra paths configuration cannot coexist with the soft reconfig configuration.
If the system runs out of physical memory, the BGP process exits and requires a manual restart using the process restart bpm command.
-
Dropped prefixes can cause network inconsistencies, potentially leading to routing loops.
-
During a Non-Stop Routing (NSR) switchover, standby and active BGP sessions may drop different prefixes, causing inconsistent BGP tables.
Benefits of BGP maximum-prefix and discard extra paths
BGP maximum-prefix and discard extra paths functionality provides these benefits:
-
Limits the memory usage of BGP by dropping excess prefixes received beyond the configured maximum.
-
Prevents session flapping, ensuring stability of the BGP peer even when the prefix limit is exceeded.
-
Helps maintain operational continuity by avoiding disruptions caused by exceeding the prefix limit.
Configure BGP maximum-prefix and discard extra paths
The purpose of this task is to configure a BGP neighbor to discard extra paths when the maximum prefix limit is exceeded, ensuring session stability and controlled memory usage.
This task involves setting up a BGP neighbor with a maximum prefix limit and enabling the discard extra paths option to drop prefixes exceeding the limit without session flapping.
Follow these steps to configure BGP maximum-prefix discard extra paths:
Before you begin
-
Identify the BGP autonomous system (AS) number.
-
Determine the neighbor IP address and the maximum prefix limit to configure.
Procedure
|
Step 1 |
Enter configuration mode and specify the BGP autonomous system number to enable BGP configuration. Example:
|
|
Step 2 |
Define the neighbor IP address and enter the address family submode to configure the specific type of traffic. Example:
|
|
Step 3 |
Configure the maximum prefix limit and enable the discard extra paths option to prevent excess prefixes from causing disruptions. Example:
|
|
Step 4 |
Save the configuration to apply changes. Example:
|
|
Step 5 |
Verify the running configuration on the system. Example:
|
|
Step 6 |
Use the show bgp neighbor command to view the neighbor configuration and status. Review the output for these details:
Example:
|
The configuration ensures that the BGP neighbor limits the number of prefixes to 1,000 and discards extra paths without flapping the session.
Summary of key commands for BGP maximum-prefix and discard extra paths
|
Command |
Description |
|---|---|
|
|
Configures the maximum prefix limit and enables the discard extra paths option. |
|
|
Displays the BGP neighbor's configuration and status, including discard extra paths details. |
|
|
Manually restarts the BGP process when it exits due to insufficient physical memory. |
Feedback