Skip to main content
nevan
Staff
Staff
September 8, 2025

Technical Tip: Understanding 'max-neighbor-num' in BGP 'neighbor-range'

  • September 8, 2025
  • 0 replies
  • 690 views
Description This article describes the feature 'max-neighbor-num' in BGP configuration under neighbor-range.
Scope FortiGate.
Solution

The 'max-neighbor-num' is a limit that controls how many dynamic BGP sessions can be established from the IP range defined in prefix inside config neighbor-range. This feature prevents the FortiGate from being overwhelmed by limiting the number of neighbors that it will actually allow. The configuration example is shared below.

IPv4:


config neighbor-range
        edit 2
                set prefix x.x.x.x x.x.x.x
                set max-neighbor-num <value>
                set neighbor-group "FGT"
           next
 end

 

IPv6:

config neighbor-range6
        edit 2
                set prefix6 2001::xx:xx:xx:0/xx
                set max-neighbor-num <value>

                           set neighbor-group "FGT"
           next
 end

When dynamic peers inside the prefix attempt to establish BGP, the FortiGate will accept them only until the maximum number is reached. Once the limit is hit, additional peers from that range will be denied and no new sessions will be formed. 

 

The default value of the 'max-neighbor-num' is zero ('0') for both IPv4 and IPv6 address group. In case if the neighbor works but the neighbor-range does not work for BGP neighbor establishment, make sure the  'max-neighbor-num' is a non-zero value and set to the expected number according to the volume of valid neighbors. 

Additionally, if the neighbor group name and group password need to be checked carefully to build up the neighborship within the neighbor range. 

 

Related arrticle:
Technical Tip: The BGP Neighbor group password

    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
    Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!