2 wan load balancing and failover

Hello,

I’ve already read multiple articles on the forum, but I’m still lost … and I need some advise of the community.

I’ve 2 ISP 1 cable and 1 fiber, I don’t have the choice and must keep their modems/routers, I’ve ordered a MikroTik CCR1009-7G-1C-1S+ and he will be connected on each modem and to a Netgear GS728TX with a 10 GB fiber

1/ I wish to use the cable operator as failover
2/ I wish to load balance the 2 * 1 Gbits of the fiber (the modem cannot do LACP, bonding or usefull thing)

I was thinking to something like that :

/ip address
add address=192.168.0.11/24 interface=ether1
add address=192.168.0.12/24 interface=ether2
add address=192.168.0.13/24 interface=ether3
add address=192.168.2.1/23 interface=Local

/ip route
add gateway=192.168.0.2
add gateway=192.168.0.1
add gateway=192.168.0.2%ether1 routing-mark=first
add gateway=192.168.0.2%ether2 routing-mark=other
add gateway=192.168.0.1%ether3 routing-mark=fo

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
add action=masquerade chain=srcnat out-interface=ether3

/ip firewall mangle
add action=mark-routing chain=prerouting src-address=192.168.2.0/23 new-routing-mark=first

In all case thanks for having taking time to read my first steps …

Im confused,
You want the cable one as failover and then you ask for load balancing.
Which is it?

If you have a load balancing (using both ISPs) and one of them becomes unavailable, I would assume that the single router available is still used and would take 100% of traffic and no need for failover setup. in my case one cable and one fiber, the fiber is my main source and the cable is strictly for backup. I do point all email traffic POP / SMTP to the backup as our email addresses and accounts used are with the backup ISP (our initial provider).

Sorry if it was not clear, and thanks for you reply.

Load Balancing part is for the fiber isp, he provide 2gbit, but the switch of this one have only gigabit port without the possibility to aggregate the ports. And the the cable isp is just for failover. So if I’m wrong (and this is probably the case), how I can “aggregate” the port of the fiber isp, if the load balancing isn’t the right way ?

Thanks.

So you have a 2 gig fiber capacity comeing from the ISP?
What modem are they providing? The CCR1009 has an SFP port and an SFP+ port.
For the SFP port that maxes out at 1.25gigs so it depends if the modem negotiates at 1gig or 1.25g gig.

The SFP+ port is designed to work at 10gigs, but I have the S+J10 ethernet variant (not fibre) and I see in the advertise section
1gig full, 2.5 gig full, 5gig full and 10gig full.

So much depends on what sfp+ cage you get and what the ISP puts out??

Your question is above my head and perhaps sindy or sob or mkx can answer…??
Just guessing but I would say there is no way to load balance between one ISP connections from one connection into two connection?? that I am aware of?
Are they coming in on different vlans??

Just follow this guide on load balancing.
http://forum.mikrotik.com/t/advanced-routing-failover-without-scripting/136599/1

You can load balance the two 1G coming from fibre only or load balance on all 3 connections (fiber + 2x 1G cable).
Load balancing and backup is pretty much the same from setup point of view.
The only difference is which routes are active (in LB all routes are active = same distance), in failover the backup
route has a higher distance than the other ones and will only be used if normal routes can not be reached.

Thanks again :), I must use the modem of the ISP so I can’t connect a fiber directly on the Microtik. The SFP+ will be used to connect on the GS728TX behind. Both ISP are connected with proprietary modem, and dhcp activated (on their side, probably it was more smart from my side to explain more)

Want something simple is always complicated :frowning:


Thanks for your assistance, I’ve already check this thread and I was not sure about how to handle it. So for load balancing part

ISP20 = fiber (lan1)
ISP21 = fiber (lan2)
interface ip = 192.168.1.1
microtik eth0 = 192.168.2.1
microtik eth1 = 192.168.2.2

ISP1 = cable
interface ip = 192.168.0.1
microtik eth2 = 192.168.2.3 ?!


/ip route
add dst-address=1.1.1.1 gateway=192.168.1.1 scope=10
add dst-address=8.8.8.8 gateway=192.168.1.1 scope=10
add dst-address=8.8.8.8 gateway=192.168.0.1 scope=10
add dst-address=1.1.1.1 gateway=192.168.0.1 scope=10

/ip route
add distance=1 gateway=1.1.1.1 routing-mark=ISP20 check-gateway=ping
add distance=1 gateway=8.8.8.8 routing-mark=ISP20 check-gateway=ping

/ip route
add distance=1 gateway=8.8.8.8 routing-mark=ISP21 check-gateway=ping
add distance=1 gateway=1.1.1.1 routing-mark=ISP21 check-gateway=ping

/ip route
add distance=2 gateway=1.1.1.1 routing-mark=ISP1 check-gateway=ping
add distance=2 gateway=8.8.8.8 routing-mark=ISP1 check-gateway=ping

I would first start with load balancing or failover without GW check to make sure things work.
(I also not sure how the GW check will work as two connections (fiber) have the same GW anyhow…)

Actually the Wiki entry for PCC/basic load balancing gives a simpler example and also explains what needs to be done step by step:
https://wiki.mikrotik.com/wiki/Manual:PCC
Its a lot of info in the first place but it is very clear once you read it several times.

Fundamentally two ways to do “load balancing” (oversimplified statement):

  • You could have for example 3 different IP subnets and map them each on seperate WAN interface.
  • You would only need to define a route for each IP range and nothing else.
    In such case you will not need MANGLE and routing marks etc. which is simple, but means also your setup is somehow “hard wired”
    and if you suddenly want to change things you need to change IP address ranges etc.

The second method is using MANGLE, which basically allows to mix and match all data flow in various ways onto the
3 connections. This can be done via PCC (distribute traffic evenly over any number of interfaces) or via other methods.
Anyhow MANGLE is the tool and it allows to “mark” connection and traffic based on your defined rules and criteria.
THis is the best/most flexible way as by changing just your rules you can modify how traffic goes out.
But it is a bit more complex, you need to make sure incoming traffic also gets assigned to the right route etc.
All this is explained in the above mentioned PCC example.

I suggest have a look and ask more questions when they arise…

Thanks, I will check this (multiple time for sure). :slight_smile: