Controlling Shared BGP Routes


Keeping your router table in check is something that any network administrator should be concerned with, especially with BGP. Accepting a full routing table from your ISP over BGP can put a good bit of stress on your router in terms of memory, etc. The fact is with no control, your router could be flooded with an extreme number of BGP routes. Controlling these routes allows for the best possible performance of the router and the most control over the network for you, the administrator.

An easy way to accomplish this is with prefix-lists. Here is a quick way to control what you are receiving from your ISP:

ip prefix-list default-route seq 10 permit

This creates the prefix-list and as you can see, has the standard you would see with a default route. Now what you need to do is apply this to your BGP neighbors individually. The process of applying the prefix-list to a neighbor looks like this:

router bgp 65000
neighbor prefix-list default-route in

With that statement, the routed coming from (on an inbound basis) are filtered to allow only routes in the prefix-list, in this case called ‘default-route’, to be received.

This can also be done on an outbound basis as well. Say for instance you have multiple routers internally peered together sharing routes. You also connect to your ISP(s) with these routers. You do not want to share, nor will your ISP accept, all of your routes, especially internal routes. A prefix-list can make sure only your public class-c and larger networks of public subnets are shared with your ISP.

That could look like this:

ip prefix-list public-subnet seq 10 permit

Then you would need to apply this additional prefix to the neighbor just like the other, only this one would be on an outbound basis:

router bgp 65000
neighbor prefix-list public-subnet out

Per that example, only the routes for subnet would be shared out to our BGP neighbor That is a basic example of how you can control the inbound and outbound sharing of BGP routes. Through some fine tuning, you can make your routing label hold specifically the routes you are wanting.

As always, if there are any questions, post below.


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.