maximum-prefix

To control how many prefixes can be received from a neighbor, use the maximum-prefix command. To disable this function, use the no form of this command.

maximum-prefix maximum [ threshold ] [ restart restart-interval ] [ warning-only ]

no maximum-prefix

Syntax Description

maximum
Maximum number of prefixes allowed from the specified neighbor. The number of prefixes that can be configured is limited only by the available system resources on a router. Range: 1 to 300000.
threshold
(Optional) Specifies the percentage of the maximum-prefix limit at which the router starts to generate a warning message. Range: 1 to 100. Default: 75.
restart interval
(Optional) Specifies the time interval (in minutes) that a peering session is reestablished. Range: 1 to 65535.
warning-only
(Optional) Allows the router to generate a syslog message when the maximum-prefix limit is exceeded, instead of terminating the peering session.

Command Default

This command is disabled by default. Peering sessions are disabled when the maximum number of prefixes is exceeded. If you do not configure the restart interval, a disabled session stays down after the maximum-prefix limit is exceeded.

Command Modes

Peer template configuration mode
BGP router configuration mode
BGP neighbor address-family configuration mode

Command History

Release
Modification
5.0(3)N1(1)
This command was introduced.

Usage Guidelines

The number of prefixes that can be configured is limited only by the available system resources on a router.

The maximum-prefix command allows you to configure a maximum number of prefixes that a Border Gateway Protocol (BGP) routing process accepts from the specified peer. This feature provides a mechanism (in addition to distribute lists, filter lists, and route maps) to control prefixes received from a peer.

When the number of received prefixes exceeds the maximum number configured, BGP disables the peering session (by default). If you configure the restart interval, BGP automatically reestablishes the peering session at the configured time interval. If you do not configure the restart interval and a peering session is terminated because the maximum prefix limit has been exceed, the peering session is not reestablished until you enter the clear ip bgp command. If the warning-only keyword is configured, BGP sends only a log message and continues to peer with the sender.

There is no default limit on the number of prefixes that can be configured with this command. Limitations on the number of prefixes that can be configured are determined by the amount of available system resources.

Examples

This example shows how to set the maximum prefixes that are accepted from the 192.168.1.1 neighbor to 1000:

switch(config)# router bgp 64496
switch(config-router)# network 192.168.0.0
switch(config-router)# maximum-prefix 1000
switch(config-router)#
 

This example shows how to set the maximum number of prefixes that are accepted from the 192.168.2.2 neighbor to 5000. The router is also configured to display warning messages when 50 percent of the maximum-prefix limit (2500 prefixes) has been reached.

switch(config)# router bgp 64496
switch(config-router)# network 192.168.0.0
switch(config-router)# maximum-prefix 5000 50
switch(config-router)#
 

This example shows how to set the maximum number of prefixes that are accepted from the 192.168.3.3 neighbor to 2000. The router is also configured to reestablish a disabled peering session after 30 minutes.

switch(config)# router bgp 64496
switch(config-router)# network 192.168.0.0
switch(config-router)# maximum-prefix 2000 restart 30
switch(config-router)#
 

This example shows how to set the warning messages that are displayed when the maximum-prefix limit (500) for the 192.168.4.4 neighbor is exceeded:

switch(config)# router bgp 64496
switch(config-router)# network 192.168.0.0
switch(config-router)# maximum-prefix 500 warning-only
switch(config-router)#
 

This example shows how to set the maximum number of prefixes that are accepted from the 192.168.1.3 neighbor to 1500.

switch(config)# router bgp 64496
switch(config-router)# neighbor 192.168.1.3 remote-as 64497
switch(config-router-neighbor)# address-family ipv4 multicast
switch(config-router-neighbor-af)# maximum-prefix 1500
switch(config-router-neighbor-af)#
 

Related Commands

Command
Description
address-family (BGP neighbor)
Enters BGP neighbor address-family configuration mode.
neighbor
Configures a BGP neighbor.
network
Configures an IP prefix to advertise.
show ip bgp
Displays BGP configuration information.