Page 1 of 1

How to make local IPs prefered over BGP routes

Posted: Tue Jul 18, 2023 9:50 am
by aboshhab
Hello everyone,

I am using BGP internally to distribute routes.

when i have my local ip
dst-address 10.0.0.0/16 reachable on ether1

and i got bgp route
dst-address 10.0.0.0/24

why mikrotik prefere bgp route with 10.0.0.0/24 over my local address ?
how can i resolve it, and make mikrotik always prefere local address even with small bgp subnet mask

THANKS

Re: How to make local IPs prefered over BGP routes

Posted: Tue Jul 18, 2023 12:19 pm
by wiseroute
hello,

so, your local lan routes goes out of local router - before reaching its local destination?

you might want to read this guide :

https://wiki.mikrotik.com/wiki/Manual:B ... _Algorithm

Re: How to make local IPs prefered over BGP routes

Posted: Thu Jul 20, 2023 8:47 pm
by MaxwellSilver
The guide linked in the previous post is very useful and I recommend reading it.

In a nutshell this seems to be the issue:

10.0.0.0/24 is more specific than 10.0.0.0/16 so traffic needing to to go to 10.0.0.0/24 will take the route advertised via BGP rather than the connected route.

To resolve the issue, you might want to take a look at your address scheme.