Community discussions

MikroTik App
 
alisc
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu Dec 01, 2011 10:51 am

How To Write Filter for This BGP Scenario

Wed Aug 02, 2017 8:08 am

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 ?


Image
 
User avatar
Alferez
Frequent Visitor
Frequent Visitor
Posts: 70
Joined: Mon Sep 12, 2016 9:40 am
Location: Seville / Spain
Contact:

Re: How To Write Filter for This BGP Scenario

Wed Aug 02, 2017 10:12 am

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.
 
alisc
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Thu Dec 01, 2011 10:51 am

Re: How To Write Filter for This BGP Scenario

Wed Aug 02, 2017 6:55 pm

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
 
User avatar
Alferez
Frequent Visitor
Frequent Visitor
Posts: 70
Joined: Mon Sep 12, 2016 9:40 am
Location: Seville / Spain
Contact:

Re: How To Write Filter for This BGP Scenario

Thu Aug 03, 2017 12:12 pm

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

Who is online

Users browsing this forum: AlexM2020, rextended and 16 guests