Maximum-Prefix

This scenario demonstrates how to configure maximum-prefix limits for IPv6 BGP neighbors. The maximum-prefix command limits the number of prefixes accepted from a neighbor. When the limit is exceeded, the session can be shut down or a warning can be logged.

Test iBGP IPv6 - Maximum-prefix limit exceeded

Description

Test to verify that BGP session closes when maximum-prefix limit is exceeded. DUT0 is configured with maximum-prefix 2. DUT1 initially advertises 2 prefixes (within limit), then a third is added to exceed the limit.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set protocols bgp 20 neighbor peer address-family ipv6-unicast activate
set protocols bgp 20 neighbor peer address-family ipv6-unicast maximum-prefix 2
set protocols bgp 20 neighbor peer remote-address '2001:db8:1::200'
set protocols bgp 20 neighbor peer remote-as 20
set protocols bgp 20 parameters router-id 1.1.1.100
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address '2001:db8:1::200/64'
set protocols bgp 20 address-family ipv6-unicast redistribute static
set protocols bgp 20 neighbor peer address-family ipv6-unicast activate
set protocols bgp 20 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 20 neighbor peer remote-as 20
set protocols bgp 20 parameters router-id 1.1.1.200
set protocols static route6 '2001:db8:10::/64' blackhole
set protocols static route6 '2001:db8:20::/64' blackhole
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify iBGP session establishes with 2 prefixes (within limit).

Step 3: Run command protocols bgp show ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:1::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.100, local AS number 20 VRF default vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:1::200 0.0.0.0         4         20         2         4        0    0    0 00:00:02  Established        0        0 FRRouting/10.4.1

Total number of neighbors 1

Attention

Verify that DUT0 receives both routes.

Step 4: Run command protocols bgp show ipv6 at DUT0 and check if output matches the following regular expressions:

2001:db8:10::/64[\s\S]+2001:db8:20::/64
Show output
BGP table version is 2, local router ID is 1.1.1.100, vrf id 0
Default local pref 100, local AS 20
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 2001:db8:10::/64 fe80::dcad:beff:feef:6c10
                                             0    100      0 ?
 *>i 2001:db8:20::/64 fe80::dcad:beff:feef:6c10
                                             0    100      0 ?

Displayed 2 routes and 2 total paths

Note

Add a third static route on DUT1 to exceed the maximum-prefix limit.

Step 5: Modify the following configuration lines in DUT1 :

set protocols static route6 '2001:db8:30::/64' blackhole

Attention

Verify that DUT0 BGP session shows Idle (PfxCt) after exceeding maximum-prefix.

Step 6: Run command protocols bgp show ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:1::200.*Idle \(PfxCt\)
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.100, local AS number 20 VRF default vrf-id 0
BGP table version 4
RIB entries 0, using 0 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:1::200 0.0.0.0         4         20         6         7        0    0    0 00:00:00 Idle (PfxCt)        0        0 FRRouting/10.4.1

Total number of neighbors 1