Community discussions

MikroTik App
 
dthomas
just joined
Topic Author
Posts: 3
Joined: Fri Sep 07, 2012 10:22 pm

Issue with gateways and BGP with 2 ISP's

Wed Mar 05, 2014 9:28 pm

I've searched as much as I can and haven't found an answer.

I have 1 fiber connection to ATT and 1 to Hurricane Electric.

I followed the BGP guide on the wiki and everything works great, except I have a /25 and /26 block that aren't BGP'd through ATT.

I have my gateways setup as
0.0.0.0/0 to ATT distance 1
0.0.0.0/0 to HE distance 30

It all works fine like that, but if I want to change my default to HE obviously the 2 blocks that aren't BGP'd won't go out HE.

Is there a way for me to set just those 2 blocks to always go out ATT?

Thanks,

David
 
matthew
just joined
Posts: 10
Joined: Sat Sep 22, 2007 12:43 am
Location: Minneapolis, MN

Re: Issue with gateways and BGP with 2 ISP's

Fri Mar 14, 2014 12:15 am

Hi David,
You can probably pull this off using a prerouting firewall mangle rule with a separate routing mark for your /25 and /26.

Assuming your AT&T networks are: 172.16.16.0/25 and 172.16.17.0/26, the AT&T gateway is 12.122.125.224, and your AT&T interface is 12.122.125.225... something like this would probably work:
/ip firewall mangle
add action=mark-routing chain=prerouting disabled=no new-routing-mark=ATT passthrough=yes src-address=172.16.16.0/25
add action=mark-routing chain=prerouting disabled=no new-routing-mark=ATT passthrough=yes src-address=172.16.17.0/26
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=12.122.125.224 pref-src=12.122.125.225 routing-mark=ATT
You'd also need to add some routes for your other networks inside the "ATT" routing mark, to locally route your larger prefixes. Otherwise traffic from your /25 and /26 destined to your bigger networks are going to go out AT&T and come back in again.

I'm unsure your topology, but you probably get the idea:
/ip route
add disabled=no dst-address=198.18.0.0/22 gateway=ether2 routing-mark=ATT

Who is online

Users browsing this forum: Ahrefs [Bot] and 21 guests