cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
433
Views
4
Helpful
3
Replies

BGP Prefix Length for Advertising on Internet

hbf
Level 1
Level 1

There's a scenario where a /16 public IP pool has been advertised (via BGP) on the Internet in multiple /21 chunks. The /16 prefix is defined on router R1 (as a single prefix) from which IP addresses are being assigned to end users via DHCP.

R1 has an uplink to router R2 which has multiple /21 (chunks of the /16 prefix configured on R1) static routes pointing to R1.

R2 has an uplink to router R3 which is the Internet Gateway. R2 advertises /21 routes to R3 via BGP which in turn advertises those /21 routes on the Internet.

R1(/16 prefix) <-----> R2(Multiple /21 static routes pointing to R1) <-----> R3(Receiving /21 chunks of /16 prefix defined on R1 from R2 via BGP and then advertising those /21 prefixes on the Internet.

I'm wondering:

Why /21?

Why not advertise the whole /16 prefix as one prefix?

Or why not use any other prefix length like /22, /23 or /24?

Is it a recommended practice to advertise /21 chunks on the Internet?

Please guide.

1 Accepted Solution

Accepted Solutions

M02@rt37
VIP
VIP

Hello @hbf 

It is better to have an aggregation network prefix (dynamic way). When viable component routes that match the aggregate network prefix enter the BGP table, then the aggregate prefix is created. The originating router sets the next hop to Null0 as a discard route for the aggregated prefix for loop prevention.

The downfall of "ip route x.x.x.x/16 null0" (static way) is that the summary route is always advertised, even if the networks are not available.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

3 Replies 3

You are correct 

You need 

Ip route x.x.x.x/16 null0

Then advertise this /16 via bgp

Because bgp not advertise any prefix not found in rib

MHM

M02@rt37
VIP
VIP

Hello @hbf 

It is better to have an aggregation network prefix (dynamic way). When viable component routes that match the aggregate network prefix enter the BGP table, then the aggregate prefix is created. The originating router sets the next hop to Null0 as a discard route for the aggregated prefix for loop prevention.

The downfall of "ip route x.x.x.x/16 null0" (static way) is that the summary route is always advertised, even if the networks are not available.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @hbf ,

>>

Why not advertise the whole /16 prefix as one prefix?

Or why not use any other prefix length like /22, /23 or /24?

>> Is it a recommended practice to advertise /21 chunks on the Internet?

The choice of /21 has been a design / configuration choice just to reflect the DHCP scopes on R2.

Usually it is not possible to advertise prefixes longer then /24.

As explained by M02@rt37 and @MHM Cisco World you can on R2 advertise the whole /16 prefix instead.

this is a good choice if R2 -R3 is the only exit point to the internet. If there are other exit points the choice to advertise /21 prefixes could have a reason in an attempt to load share over multiple links / eBGP peers.

Hope to help

Giuseppe