11-09-2019 05:47 AM
I an edge WAN router that is BGP peering with a router outside of my company.
We are receiving a lot of routes, and I need to filter the routes I'm receiving, I only need a few. I have configured a distribute list, tried with a standard access-list and a prefix list. I prefer the prefix list as its cleaner. I cleared the bgp sessions and the routes are not filtered. Here is the config
router bgp 11111
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 22222
neighbor 1.1.1.1 soft-reconfiguration inbound
neighbor 1.1.1.1 distribute-list BGP-IN in
neighbor 1.1.1.1 route-map SET_LOCALPREF in
neighbor 1.1.1.1 route-map PRIMARY out
ip prefix-list BGP-IN seq 5 permit 3.3.3.3/24
ip prefix-list BGP-IN seq 10 permit 4.4.4.4/24
I'm not sure what I'm missing and why the routes are not being filtered
Solved! Go to Solution.
11-09-2019 07:13 AM
Hello,
looking at the syntax in your original post again, I think when you specify the 'distribute-list' command, your only options are standard/extended/named access lists.
If you want to use a prefix list, your neighbor statement should be:
neighbor 1.1.1.1 prefix-list BGP-IN in
11-09-2019 06:19 AM
Hello,
I just tested the below configuration, and it works fine. That said, what do the outbound route maps look like ? Also, make sure the other side is sending the exact networks that you are matching (the addresses sound like loopbacks, so make sure they really have a /24 and not a /32 mask)...
router bgp 11111
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 22222
neighbor 1.1.1.1 soft-reconfiguration inbound
neighbor 1.1.1.1 distribute-list 1 in
--> neighbor 1.1.1.1 route-map SET_LOCALPREF in ?
--> neighbor 1.1.1.1 route-map PRIMARY out ?
access-list 1 permit 3.3.3.0 0.0.0.255
access-list 1 permit 4.4.4.0 0.0.0.255
11-09-2019 06:42 AM
I tested it again and it worked with an extended access-list. The IPs I posted are not the actual IPs, and the subnet masks are all correct.
Still not sure why the prefix list wouldn't work.
11-09-2019 07:13 AM
Hello,
looking at the syntax in your original post again, I think when you specify the 'distribute-list' command, your only options are standard/extended/named access lists.
If you want to use a prefix list, your neighbor statement should be:
neighbor 1.1.1.1 prefix-list BGP-IN in
11-09-2019 07:15 AM
11-09-2019 08:49 AM
That worked!!
Thanks for your help
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide