Cisco prefix-list to strip default route from received BGP routes

In playing with some routing last night, I needed to filter the default route that we received from the BGP announcements from our peers. I didn’t find exactly what I was looking for via Google, so I began experimenting. After a dozen or so unsuccessful changes, I came up with this that actually accomplishes what I was trying to do:

ip prefix-list NO_DEFAULT_ROUTE seq 1 deny
ip prefix-list NO_DEFAULT_ROUTE seq 2 permit ge 1 le 24

Then apply that to a BGP session with something like this in your BGP configuration

 neighbor prefix-list NO_DEFAULT_ROUTE in

Although that did accomplish that goal of filtering out the default route, it turns out it still didn’t do what I wanted. Oh well. Having a static default route is probably a bad idea anyway.

One thought on “Cisco prefix-list to strip default route from received BGP routes”

Leave a Reply

Your email address will not be published. Required fields are marked *