cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

182
Views
0
Helpful
5
Replies
Beginner

Distribute list for route filtering in BGP not working

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

1 ACCEPTED SOLUTION

Accepted Solutions
VIP Mentor

Re: Distribute list for route filtering in BGP not working

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

 

 

View solution in original post

5 REPLIES 5
VIP Mentor

Re: Distribute list for route filtering in BGP not working

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

Beginner

Re: Distribute list for route filtering in BGP not working

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.

VIP Mentor

Re: Distribute list for route filtering in BGP not working

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

 

 

View solution in original post

Beginner

Re: Distribute list for route filtering in BGP not working

I will test that. I did try with a standard access-list
Beginner

Re: Distribute list for route filtering in BGP not working

That worked!!

Thanks for your help

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