Page 1 of 1

Load Balancing and failover on Dynamic IP?

Posted: Fri May 04, 2012 3:17 am
by hjf
Hi guys. I'm trying to do load balancing and failover over two ADSL lines. The problem is that both lines are from the same ISP, and both are PPPoE. So the IP is always dynamic (can't request static IP), and the biggest problem is that both connections always give me the same gateway. This seems to be the biggest problem.

Traffic comes from two separate offices and the idea is that one office (10.1.1.0/24) comes out through ADSL 1, and office 2 (10.2.1.0/24) comes out through ADSL 2. If either ADSL connection fails, route the traffic through the remaining ISP.

Most examples I've seen either use the ADSL modems in Route mode (and NAT twice, which I don't want) or use two separate ISPs, which gives you two different gateways.

I tried adding a static route and using the "Pref Source" address option, but that doesn't work. All traffic just goes through one of the modems and the other is idle.

How can I make traffic go through one connection or the other based on the source (LAN) address, if the gateway address is the same?

Re: Load Balancing and failover on Dynamic IP?

Posted: Fri May 04, 2012 6:40 pm
by dboillot
I'm doing Load balancing/fail over over 6 DSL based lines, we use PCC to do this. 2 of our lines are on the same "network" and I had problems with them when i first set them up, but with help i got them working. here's a link to the PCC page if you need to set it up first. ( http://wiki.mikrotik.com/wiki/Manual:PCC )

the part I had to change was where the gateway was looked for, here's a clip of my code.
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=108.219.188.1%IPD1 routing-mark=to_wan5 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=108.219.188.1%IPD2 routing-mark=to_wan6 scope=30 target-scope=10
instead of being the pppoe-out interface, I had to set it to the gateway IP (in my case 108.219.188.1) and add %INTERFACENAME to the end, so it would always go out that port even tho the other one had the same gateway. if you want, I can post my entire PCC code and you can edit it to your needs.

this may not do exactly what you want as is, but its a start that will get you going in the right direction.

Re: Load Balancing and failover on Dynamic IP?

Posted: Sat May 05, 2012 12:04 am
by hjf
I had to set it to the gateway IP [...] and add %INTERFACENAME to the end, so it would always go out that port even tho the other one had the same
this is exactly what i was looking for. Never would have guessed the %ifname trick... I've only used that on Windows IPv6.

thanks a lot!

Re: Load Balancing and failover on Dynamic IP?

Posted: Sun May 13, 2012 6:56 pm
by miskoolak
hi

im new in Mikrotik and i have the same problem with a little difference and i will so please if you do me a favor and help me throw this issue.

i have 5 ADSL modem 192.168.1.1-5/24 they have ppoe connections.
how can i do load balance and fail over ?

(for the gateway check i have to ping an internet ip address like 8.8.8.8 or 4.2.2.4 instead of 192.168.1.1)

Regards

Re: Load Balancing and failover on Dynamic IP?

Posted: Mon Jun 04, 2012 10:26 am
by vixxant
Check this load balancing method. then you will get the idea
http://fatalsite.net/?p=100