How To Write Filter for This BGP Scenario

hi all
good time

i have a problem to advertise IPv4 to Provider’s white BGP !

i need advertise this ip only to Provider A (AS100) :
192.168.10.0/24
192.168.20.0/24
192.168.30.0/24

i need advertise this ip only to Provider B (AS200) :
192.168.40.0/24
172.16.10.0/24

how to drop send/recieve ( 192.168.40.0/24 | 172.16.10.0/24 ) to Provider A
how to drop send/recieve ( 192.168.10.0/24 | 192.168.20.0/24 | 192.168.30.0/24) to Provider B

filters ?


Hello,

You need create two filters:

add action=accept chain=ProviderA prefix=192.168.10.0/24
add action=accept chain=ProviderA prefix=192.168.20.0/24
add action=accept chain=ProviderA prefix=192.168.30.0/24
add action=discard chain=null_route

add action=accept chain=ProviderB prefix=192.168.40.0/24
add action=accept chain=ProviderB prefix=172.16.10.0/24
add action=discard chain=null_route

You need set out-filter for every peer.

thanks a lot

Another question :

how to Manage send & Recieve Route ?
for example 192.168.10.0/24

Send Via Provider A
Recieve Via Provider B

You can set in-filter and out-filter in every peer.
In my example y use out-filter for send only selected subnet.
I always use Bogons / Martians list for incoming: https://wiki.mikrotik.com/wiki/BOGON_Address_List but you can add your networks at incomming list.

Example:


add action=discard chain=InProviderA prefix=192.168.40.0/24

If you use this filter in ProviderA input peer filter you no accept this network from your ProviderA