cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
179
Views
16
Helpful
3
Replies
Beginner

BGP and advertising 2 /25 as a /24

We split a /24 into two /25 segments:

eth 1/1 - 8.23.2.0/25

eth 1/2 - 8.23.2.128/25

eth 1/3 - 8.8.2.2 - ISP link

 

So the whole /24 lives on the router, but split. When I advertise 8.23.2.0/24 to ISP, it doesn't show up as and advertised route. Is there a way to advertise the /24? Rollup them up into a /24?

 

Thanks

Everyone's tags (2)
3 REPLIES 3
Beginner

Re: BGP and advertising 2 /25 as a /24

Hi Dave, 

 

That configuration is fine.  When you say the route doesn't show up, do you mean in the global BGP table?  Do you already have BGP established with active routes?   If so, and you are trying to advertise a more specific route than your carrier has built in their prefix list, it will be rejected.  You'll need  to contact your carrier to have your BGP session modified.   Example - if your carrier built: 

 

ip prefix-list filterlist seq 10 permit 10.0.0.0/23

and you tried to advertise either of the /24s, the routes would be rejected.  

 

If they changed the filter to:

ip prefix-list filterlist seq 10 permit 10.0.0.0/23 le 24

then the /24s would be accepted.  This is usually an option on a BGP form.  Talk to your carrier Sales Engineer, they should be able to get this set up for you. 

 

Cheers, 

 

Ben  

Highlighted
Hall of Fame Cisco Employee

Re: BGP and advertising 2 /25 as a /24

Hi Ben, hi Dave,

Please allow me to join.

Ben, very insightful and spot-on response. Rated as deserved!

Dave, a couple of additional thoughts. You did not include your routing protocol configuration so we can only guess that it is BGP and how it is possibly configured. It is always helpful to add the configuration snippet - it helps very much to understand your setup.

I do not know if you inject the two /25 networks into your BGP using the network command or using redistribution. Regarding the network command in BGP, this one needs to exactly match a route in your network before it can be injected into BGP. If you have split the /24 network into two /25 subnets, that is fine, but that also means that you cannot specify the original /24 network using the network command and expect it to be advertised in BGP - because such a network does not exist in your routing table, only the two /25 networks do. You would need to configure aggregation in BGP to advertise a single /24 prefix back to your ISP.

However, there is a simple trick you can do. Let me give you an example config for it first:

ip route 8.23.2.0 255.255.255.0 null0
!
router bgp ...
 network 8.23.2.0 mask 255.255.255.0

Here, you define a static route covering the whole /24 prefix you have been assigned, and pointing to Null0, and then inject this prefix into BGP using a single network command, without any additional redistribution, filtering, or summarization. This will work nicely because of multiple reasons:

  • The network command matches the static route exactly, and injects it into BGP to be advertised
  • Since the route is static, it won't flap, meaning BGP will be very silent
  • Since you are using more specific prefixes on your interfaces, they will always be preferred to this aggregated route; the aggregate route won't override any of its own existing subnets
  • If you shut down or disconnect any of the interfaces with the subnets, the Null0 route will simply cause traffic for this nonexistent subnet to be dropped, rather than possibly routed back to your ISP if you have a default route pointing back to it. It will thereby prevent routing loops or misrouting.

In essence, this approach is very similar to aggregation using the aggregate-address command in BGP, but in terms of BGP operation, it is simpler (no need to reevaluate the aggregate prefix and its attributes every time a component subnet changes).

My two cents...

Best regards,
Peter

Hall of Fame Expert

Re: BGP and advertising 2 /25 as a /24

Hello Dave,

if you need to advertise only the /24 you can follow Peter's suggestions.

 

Now, the new default setting for BGP is no auto-summary this means that BGP network command requires an exact match to trigger a BGP advertisement.

So in your case the alternate way to achieve the desired behaviour is:

 

a)  Advertise component routes in BGP with correct mask 255.255.255.128 = /25

router bgp <yourAS>

network 8.23.2.0 255.255.255.128

network 8.23.2.128 255.255.255.128

 

This will add the component routes to the BGP table because the netmask is an exact match for 8.23.2.0/25 and 8.23.2.128/25.

However, the ISP would like to see an aggregate route like 8.23.2.0/24

 

b)  Create an aggregate address and add the keyword summary-only

you add the following lines

router bgp <your-AS>

aggregate-address 8.23.2.0 255.255.255.0 summary-only

 

The main difference with the static route to null0 is the following:

the aggregate-address will be advertised only if at least one of the two component routes is alive and present in the BGP table.

 

the static route to null0 will be always advertised, but if one of the component routes is not alive packets with a destination address  within that component will be silently dropped by null0 that is a waste bin.

 

Hope to help

Giuseppe

 

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards