Community discussions

MikroTik App
 
xallat
just joined
Topic Author
Posts: 1
Joined: Sun Jan 21, 2018 9:54 am

2 default-gateways in router

Sun Jan 21, 2018 9:57 am

dears..

I have a router routed to two subnets of Public IP from ETH1, how can i managing the two gateways in order to working both of them.

Regards.
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: 2 default-gateways in router

Sun Jan 21, 2018 1:32 pm

Hi

You have some options. Have a look at: https://wiki.mikrotik.com/wiki/Load_Balancing

Just out of curiosity: are you multi-homing your eth1 with 2 static subnets?
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: 2 default-gateways in router

Sun Jan 21, 2018 1:43 pm

The above article describes balancing, you maybe don't even want that.
The simple case of having two default routes for two different external addresses is handled easlily like this:
- add the second default route with correct gateway and a specified route mark (you can choose any word there)
- add an ip route rule to match the corresoponding external address and specify action lookup and select that route mark you created

This will route traffic with the selected source address via the alternate default route.
When all you want is reply to external traffic with the proper address and route, or to send traffic with some defined source address
(e.g. tunnel, src-nat etc) this is all you need to do.
 
User avatar
lbachero
newbie
Posts: 38
Joined: Wed Oct 08, 2014 4:39 pm
Location: Dublin
Contact:

Re: 2 default-gateways in router

Mon Jan 22, 2018 7:22 pm

Do you have 2 Public IP's on the same interface? How?

So, if you want to choose a main gateway, you can set the metric attribute. The first with metric 1 and the second with metric 2.
You can set it creating static routes or setting on the WAN configuration (DHCP, PPPoE, etc).
Or you can create a balancing traffic like the guys above said.

Regards,
Leandro de Lima Camargo

Who is online

Users browsing this forum: homelap2024, KozmoNaut, mlvnd, tromideh and 48 guests