How to manipulate BGP Routes – part 1
Posted by: Sulaiman Syed
After knowing how BGP select the best route for the routing update, using the BGP PAs. The next step would be to manipulate these PAs to give the desired route for NLRI
BPG mainly uses 4 variations to manipulate the routes:
- neighbor distribute-list (standard ACL / extended ACL)
- neighbor prefix-list
- neighbor filter-list
- neighbor route-map
The first two distribute-list and prefix-list will be able to match the network, and the subnet mask. a prefix-list is a straightforward operation. match certain network, with certain subnet mask and filter it out. a simple example that will deny network range 10.20.0.0/24 to 10.20.255.0/24 and permit any other network to be advertise to the neighbor will follow the following syntax
ip prefix-list sample seq 5 deny 10.20.0.0/16 ge 16 le 24
ip prefix-list sample seq 5 permet 0.0.0.0/0 le 32
router bgp 123
neighbor 1.1.1.1 prefix-list sample out.
BGP’s distributed-list uses ACL to match prefix and prefix length. The way extended ACL is interpreted differently than the normal extended ACL. extended ACL will be used to match the network length (prefix), and the prefix length (subnet). for example
ip prefix-list sample_2 seq 5 deny 10.5.0.0/16
ip prefix-list sample_2 seq 5 deny 10.20.0.0/16 ge 16 le 24
can be written as
ip access0list extended sample_2
deny ip host 10.5.0.0 host 255.255.0.0
deny ip host 10.20.0.0 0.0.255.255 host 255.255.255.0
The following documentation will further help understanding prefix-list. In the next entry, we would discuss how to use neighbor filter-list to match the AS_PATH contents for route manipulation. and a simple guideline when to use which method out of the four to filter and manipulate BGP routes.




