set protocols bgp neighbor maximum-prefix

set protocols bgp neighbor maximum-prefix


The set protocols bgp neighbor maximum-prefix command sets a maximum number of prefixes we can receive from a given neighbor. If this number is exceeded, the BGP session will be destroyed.
The delete protocols  bgp neighbor maximum-prefix command disables the maximum number of prefixes limit.

 

Command Syntax

set protocols bgp [vrf <vrf-name>neighbor <ip> ipv4-unicast maximum-prefix <max-prefix-number>

delete protocols bgp [vrf <vrf-name>neighbor <ip> ipv4-unicast maximum-prefix <max-prefix-number>

 

Parameter

Parameter

Description

vrf <vrf-name>

Optional. Specifies a VRF name. The value is a string. It’s a user-defined VRF set by the command set ip vrf <vrf-name> [description <string>].

neighbor <ip>

Specifies the IPv4 address of a peer.

peer-group <peer-group>

Specifies a peer group.

interface <interface>

Specifies an L3 interface for BGP connection. The value could be a VLAN interface name, loopback interface name, routed interface or sub-interface name.

maximum-prefix <max-prefix-number>

Specifies the maximum number of prefixes allowed from the specified neighbor. The value is an integer from 1 to 4294967295.
By default, there is no limit for the maximum number of prefixes.

 

Usage Guidelines

In practice, it is generally preferable to use a prefix-list to limit what prefixes are received from the peer instead of using this knob. Tearing down the BGP session when a limit is exceeded is far more destructive than merely rejecting undesired prefixes. The prefix-list method is also much more granular and offers much smarter matching criterion than number of received prefixes, making it more suited to implementing policy.

 

Example
• This example sets the prefix limit to 1000 prefixes.

admin@XorPlus# set protocols bgp neighbor 2.2.2.2 ipv4-unicast maximum-prefix 1000 admin@XorPlus# commit

 

Copyright © 2025 Pica8 Inc. All Rights Reserved.