Page 1 of 1

2nd gateway as failover AND mark routing?

Posted: Mon Oct 02, 2017 7:10 pm
by shivansps
Ok right now i have a:

ISP 1: DHCP client running on ether1, with distance 1, and ive added a routing filter to enable check gateway.
ISP 2: PPPoE client running on ether5 with distance 3.

So far so good, the failover is working, but i want a certain ip to run ONLY on ISP 2.
I could add a mark routing to the PPPoE client and add a mangle rule to force that ip to use the 2nd gateway, that works but adding mark route to the 2nd gateway seems to disable the failover because all other ips do not switch to the 2nd gateway after the first one is down.

Any ideas?

Re: 2nd gateway as failover AND mark routing?

Posted: Mon Oct 02, 2017 7:40 pm
by shivansps
nevermind, ive already figured it out, ive added a static route that uses "PPPoE-ISP2" as the gateway, and that is one using mark routing.

Re: 2nd gateway as failover AND mark routing?

Posted: Mon Oct 02, 2017 8:04 pm
by AnupamPradhan
Hi shivansps,

I have the same requirement for failover. Can you please share how you did the failover ?

Re: 2nd gateway as failover AND mark routing?

Posted: Tue Oct 03, 2017 1:56 am
by shivansps
For ISP 1:
A DHCP client running on ether1 port, enable "add default route" and set a distance of 2.

For ISP 2:
A PPPoE Client running on ether5 port (by default is set as slave port, so remember to set Master port to "none" in its interface first), enable "add default route" and set a distance of 4.

Now open a terminal
/routing filter
add chain=dynamic-in distance=2 set-check-gateway=ping set-distance=1
Thats petty much it.

If you want to add load balance as well as the wiki indicates you will also need to do this so both ISP gateway will have a check gateway enabled on them.
/routing filter
add chain=dynamic-in distance=4 set-check-gateway=ping set-distance=3

Re: 2nd gateway as failover AND mark routing?

Posted: Mon Oct 16, 2017 9:01 am
by arafat586
Failover configuration step by step here is the tutorial https://www.youtube.com/watch?v=6k76D-cLE1o