BGP route filtering

Hi, I am running BGP internally on my network - this works well most of the times, however there are two things I can’t work out how to do

with “advertise connected” routes enabled, I want to be able to filter out a specific route so it is not advertised at all. This is usually a subnet attached to an Ethernet interface that is masqueraded onto the larger network.

Example1

interface IP addresses
Wlan1 172.20.20.5/30
Wlan2 172.20.20.9/30
Ether1 192.168.0.1/24

I would like the router to collect routes and advertise routes on Wlan1 & Wlan2, but not advertise 192.168.0.0/24 that is bound to Ether1

Any assistance in accomplishing this would be greatly appreciated

*) set out-filter in bgp peers configuration
*) add routing filter
/routing filter add chain= prefix=192.168.0.0/24 action=discard

Excellent - thanks for that - much appreciated

Is it possible to add a list of prefixes to a filter

for example filter out

192.168.0.0/16
10.0.0.0/8
172.18.0.0/24

/routing filter add chain= prefix=192.168.0.0/24 action=discard
/routing filter add chain= prefix=10.0.0.0/8 action=discard
/routing filter add chain= prefix=172.18.0.0/24 action=discard

=)

Hi all :slight_smile:

When I do the same but only for OSPF nothing is happened :frowning:

R1:

/routing filter add chain=ospf-out prefix=192.168.0.0/24 type=connect action=discard

Route 192.168.0.0/24 still appears on my R2…

Is there any additional config for OSPF for route filter?

Thanks

remove type=connect

Thanks a lot, I’ll try that :slight_smile: