neighbor maximum-prefix

Specifies the maximum number of IP network prefixes (routes) that can be learned from a specified neighbor or peer group.

Syntax

neighbor { ip-address | ipv6-address | peer-group-name } maximum-prefix num [ threshold ] [ teardown ] [ restart-interval restart-interval-in-minutes ]
no neighbor { ip-address | ipv6-address | peer-group-name } maximum-prefix num [ threshold ] [ teardown ] [ restart-interval ]

Command Default

This feature is disabled.

Parameters

ip-address
IPv4 address of the neighbor.
ipv6-address
IPv6 address of the neighbor.
peer-group-name
Peer group name configured by the neighbor peer-group-name command.
num
Maximum number of IP prefixes that can be learned. Range is from 0 through 2147483647. Default is 0 (unlimited).
threshold
Specifies the percentage of the value specified by num (IP prefixes) that causes a syslog message to be generated. Range is from 1 through 100.
teardown
Tears down the neighbor session if the maximum number of IP prefixes is exceeded.
restart-interval restart-interval-in-minutes
After a session is torn down, this value controls the duration after which the session is restarted. Range is 1-65535 minutes.

Modes

BGP address-family IPv4 unicast configuration mode

BGP address-family IPv6 unicast configuration mode

BGP address-family IPv4 unicast VRF configuration mode

BGP address-family IPv6 unicast VRF configuration mode

BGP address-family L2VPN EVPN configuration mode

Usage Guidelines

The no form of the command restores the defaults.

The maximum number of prefixes that can be learned from a specific neighbor or from a peer-group is specified in the maximum-prefix configuration.

The teardown parameter for this command indicates that the neighbor session will be brought down when the number of learned prefixes exceeds the value configured in the maximum-prefix configuration.

When a session is brought down due to the above reason, it has to be manually restored using either of the clear ip bgp neighbor all or the clear ip bgp neighbor commands.

When both the maximum-prefix and teardown parameters are configured, the neighbour session is automatically torn-down when the maximum-prefix value is exceeded. When the restart-interval is also configured, this torn-down session is restarted automatically when the duration specified in the restart-interval-in-minutes expires.

Examples

The following example sets the maximum number of IPv4 prefixes that will be accepted from the neighbor with the IP address 10.11.12.13 to 100000, and sets the threshold value to 80%.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# address-family ipv4 unicast
device(config-bgp-ipv4u)# neighbor 10.11.12.13 maximum-prefix 100000 threshold 80

The following example, for VRF instance "red," sets the maximum number of prefixes that will be accepted from the neighbor with the IPv6 address 2001:2018:8192::125 to 100000, and sets the threshold value to 90%.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# address-family ipv6 unicast vrf red
device(config-bgp-ipv6u-vrf)# neighbor 2001:2018:8192::125 maximum-prefix 100000 threshold 90

The following example sets the maximum number of prefixes that will be accepted from the neighbor with the IP address 10.1.2.3 to 100000 in L2VPN EVPN configuration mode.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# address-family l2vpn evpn
device(config-bgp-evpn)# neighbor 10.1.2.3 maximum-prefix 100000

The following example extends the previous example to configure a threshold value to generate a RASLOG entry. The threshold value is set at 80% of the configured prefixes.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# address-family l2vpn evpn
device(config-bgp-evpn)# neighbor 10.1.2.3 maximum-prefix 100000 80 

The following example sets the maximum number of prefixes that will be accepted from the neighbor with the IP address 10.1.2.3 to 100000 in L2VPN EVPN configuration mode. It also configures a threshold for generating a RASLOG entry. The example command then configures a restart interval to restart the session after 7 minutes when the interface is shut down due to maximum prefixes being exceeded.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# address-family l2vpn evpn
device(config-bgp-evpn)# neighbor 10.1.2.3 maximum-prefix 100000 80 restart-interval 7 

The following example sets the maximum number of IPv6 prefixes that will be accepted from the neighbor with the IP address 10.11.12.13 to 10000, and sets the threshold value to 80%.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# address-family ipv6 unicast
device(config-bgp-ipv6u)# neighbor 10.11.12.13 maximum-prefix 10000 threshold 80