Solution | Configuration example.
When configured as follows:
config router bgp
config neighbor
edit "10.0.0.3"
set maximum-prefix 5
set maximum-prefix-warning-only enable/disable
...
next
end
end
Set maximum-prefix 5 and maximum-prefix-warning-only enable.
When a neighbor advertises prefixes exceeding the maximum, a warning is logged, but the prefixes are still accepted. Messages are output both before and after the limit is reached.
System event log:
date=2026-06-02 time=15:29:13 eventtime=1780381753391719966 tz="+0900" logid="0103020304" type="event" subtype="router" level="warning" vd="root" logdesc="Routing log warning" msg="BGP: %BGP-3-MAXPFXEXCEED: No. of prefix received from 10.0.0.3 (afi-safi 1-1): 6 exceed limit 5"
date=2026-06-02 time=15:29:13 eventtime=1780381753391709026 tz="+0900" logid="0103020304" type="event" subtype="router" level="warning" vd="root" logdesc="Routing log warning" msg="BGP: %BGP-4-MAXPFX: No. of prefix received from 10.0.0.3 (afi-safi 1-1): reaches 4, max 5"
# get router info routing-table bgp
Routing table for VRF=0
B 192.168.10.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.11.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.12.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.13.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.14.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.15.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.16.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.17.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.18.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.19.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
B 192.168.20.0/24 [200/0] via 10.0.0.3 (recursive is directly connected, port7), 00:00:35, [1/0]
# get router info bgp summary
VRF 0 BGP router identifier 2.2.2.2, local AS number 64511
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.0.0.3 4 64511 55 54 0 0 0 00:45:23 11
Total number of neighbors 1
Set maximum-prefix 5 and maximum-prefix-warning-only disable.
Routes exceeding the configured maximum are not accepted from the neighbor advertising them.
System event log:
date=2026-06-02 time=15:42:39 eventtime=1780382559323941397 tz="+0900" logid="0103020300" type="event" subtype="router" level="warning" vd="root" logdesc="BGP neighbor status changed" msg="BGP: %BGP-5-ADJCHANGE: VRF 0 neighbor 10.0.0.3 Down BGP Notification FSM-ERR"
date=2026-06-02 time=15:42:39 eventtime=1780382559323892124 tz="+0900" logid="0103020304" type="event" subtype="router" level="warning" vd="root" logdesc="Routing log warning" msg="BGP: %BGP-3-NOTIFICATION: sending to 10.0.0.3 6/1 (Cease/Maximum Number of Prefixes Reached.) 7 data-bytes [00 01 01 00 00 00 05]"
date=2026-06-02 time=15:42:39 eventtime=1780382559323881641 tz="+0900" logid="0103020304" type="event" subtype="router" level="warning" vd="root" logdesc="Routing log warning" msg="BGP: %BGP-3-MAXPFXEXCEED: No. of prefix received from 10.0.0.3 (afi-safi 1-1): 6 exceed limit 5"
date=2026-06-02 time=15:42:39 eventtime=1780382559323871181 tz="+0900" logid="0103020304" type="event" subtype="router" level="warning" vd="root" logdesc="Routing log warning" msg="BGP: %BGP-4-MAXPFX: No. of prefix received from 10.0.0.3 (afi-safi 1-1): reaches 4, max 5"
date=2026-06-02 time=15:42:14 eventtime=1780382534074410589 tz="+0900" logid="0103020300" type="event" subtype="router" level="warning" vd="root" logdesc="BGP neighbor status changed" msg="BGP: %BGP-5-ADJCHANGE: VRF 0 neighbor 10.0.0.3 Up "
# get router info routing-table bgp
No route available
# get router info bgp summary
VRF 0 BGP router identifier 2.2.2.2, local AS number 64511
BGP table version is 1
0 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.0.0.3 4 64511 20 23 0 0 0 never Idle (PfxCt)
Total number of neighbors
|