Community discussions

MikroTik App
 
sporkman
newbie
Topic Author
Posts: 32
Joined: Thu May 02, 2013 4:37 am

Best load balancing method for 4 WAN links

Mon Dec 30, 2013 7:14 am

I was reviewing the various load-balancing options for multiple links (ECMP, PCC, nth), and they all seem reasonable.

What I'm wondering is with each line being 15/2, whether the matter of which method is most efficient comes into play. Hardware is the RB2011.

Also I'd really like to shoot for the most seamless end user experience over speed - the air links on the other side of this are not incredibly high-bandwidth, so strict per-packet is not really going to give people better speed. More important is that their Netflix, SSL-secured banking sessions, and VoIP work without interruption when the 10 minute route table flush happens

If 3 out of 4 lines go down, I still want everyone running through the remaining circuit.

What's my best option in that scenario?
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: Best load balancing method for 4 WAN links

Mon Dec 30, 2013 10:23 am

The best method is pcc. In the mangle pcc section use "both addres and port" or "dst address"

Send from my mobile phone using Tapatalk.
 
tiernano
Frequent Visitor
Frequent Visitor
Posts: 85
Joined: Fri Jul 20, 2012 1:51 pm

Re: Best load balancing method for 4 WAN links

Thu Jan 02, 2014 1:40 pm

as c0d3rSh3ll mentions, PCC is what i am using with both addresses and ports being used. As for seamless for the user, it works 95% of the time without any issues... I have had to set up a set of rules to send specific addresses over a specific connection, mainly for issues with session state... for example, the mikrotik forums do not like you hitting them from different addresses, so i needed to tell my router to send all traffic going to the mikrotik routers though a particular WAN link...

example is available here: https://gist.github.com/tiernano/8217968

I have 3 connections myself (2@200mb/10mb and 1 @70/20). this is done as follows:

https://gist.github.com/tiernano/8218016

If you have any questions, give me a shout. I am planning on wiriting up a proper explanation of how this works eventually...
 
efaden
Forum Guru
Forum Guru
Posts: 1708
Joined: Sat Mar 30, 2013 1:55 am
Location: New York, USA

Re: Best load balancing method for 4 WAN links

Thu Jan 02, 2014 2:42 pm

Have you seen the bandwidth method from the tiktube presentation? I'll post a link when I get to my computer.

Sent from my SCH-I545 using Tapatalk
 
efaden
Forum Guru
Forum Guru
Posts: 1708
Joined: Sat Mar 30, 2013 1:55 am
Location: New York, USA

Re: Best load balancing method for 4 WAN links

Thu Jan 02, 2014 4:07 pm

Have you seen the bandwidth method from the tiktube presentation? I'll post a link when I get to my computer.

Sent from my SCH-I545 using Tapatalk

http://mum.mikrotik.com/presentations/US12/tomas.pdf

I actually helped someone else on the forums extend that to work on 30 or so ADSL connections.
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Best load balancing method for 4 WAN links

Thu Jan 02, 2014 4:46 pm

There is no BEST load-balancing method. Which one you choose should depend on your needs and what connections you have.
If the connections are 1:1 speed-wise, PCC will be good, if they are un-similiard, then bandwidth-based will be better.
 
beeman
just joined
Posts: 2
Joined: Sat Jul 13, 2013 6:17 pm
Location: Worcestershire UK
Contact:

Re: Best load balancing method for 4 WAN links

Fri Jan 03, 2014 12:36 pm

I have used Tomaskir's load balancing video & slides for a 2 WAN setup. http://tiktube.com/video/DofH3iFnjDJomG ... uKlEoLqHq=

I need to use VPN (IPsec attempted) to connect 4 routers for WISP monitoring purposes. I cannot figure out how to 'require' the VPN connections to use one WAN over the other.

Is it impossible using Tomas's load balancing system? :(
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Best load balancing method for 4 WAN links

Fri Jan 03, 2014 1:49 pm

It is possible, and it is very easy.

If you are talking about IPSec responder:
The responder will use the WAN on which the IPSec connection is establisthed.
That is handled by the WAN->ROS mangle chain already.

If you are talking about the IPSec iniciator:
Simply create a route in the main routing table for the IPSec responder's IP and point that route out a specific gateway.
Or work it into the mangle, but by default, ROS itself uses the main routing table in my setup.
 
beeman
just joined
Posts: 2
Joined: Sat Jul 13, 2013 6:17 pm
Location: Worcestershire UK
Contact:

Re: Best load balancing method for 4 WAN links

Fri Jan 03, 2014 3:40 pm

Thanks for quick response tomaskir but please could you elaborate -remember I have only just started on ROS?
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Best load balancing method for 4 WAN links

Fri Jan 03, 2014 6:52 pm

There is no simple answer to your question, it depends on your configs and topology.

Go through the presentation and the video, study it a bit, learn and test.
Then if you undrstand how it works, the things I wrote in the last post will tell you how to solve your problem.
Its better in the long run to learn it :)
 
User avatar
karina
Member
Member
Posts: 462
Joined: Sat Feb 06, 2010 2:18 am
Location: Spain

Re: Best load balancing method for 4 WAN links

Fri Jan 03, 2014 9:31 pm

I have found issues with what I call dynamic load balancing techniques as explained above. Like pcc etc. Things like making sure some connections always use the same wan add a layer of complexity. My method is simply deviding the client ip address,s into blocks and sending them out to different wants with simple mangle and routing rules
 
sporkman
newbie
Topic Author
Posts: 32
Joined: Thu May 02, 2013 4:37 am

Re: Best load balancing method for 4 WAN links

Thu Jan 09, 2014 3:11 am

I have found issues with what I call dynamic load balancing techniques as explained above. Like pcc etc. Things like making sure some connections always use the same wan add a layer of complexity. My method is simply deviding the client ip address,s into blocks and sending them out to different wants with simple mangle and routing rules
First, thanks all for the info and discussion. PCC looks like the best fit.

However, the above quoted post sounds interesting - I'm dealing with 4 equal speed links, and with all the CPE running at relatively low speeds (compared to the individual backhaul links), so divvying things up based on the source IP seems like it would help with my main goal which is to not cause chaos with those visiting any sites that don't like a client switching IPs mid-session. From what I see, it's not terribly difficult to incorporate that source IP scheme with failover, so if one link drops, the subs passing over that link failover to another.
 
sadeghnakhjavani
just joined
Posts: 6
Joined: Wed Jan 08, 2014 10:50 am

Re: Best load balancing method for 4 WAN links

Tue Jan 14, 2014 10:13 am

as c0d3rSh3ll mentions, PCC is what i am using with both addresses and ports being used. As for seamless for the user, it works 95% of the time without any issues... I have had to set up a set of rules to send specific addresses over a specific connection, mainly for issues with session state... for example, the mikrotik forums do not like you hitting them from different addresses, so i needed to tell my router to send all traffic going to the mikrotik routers though a particular WAN link...

example is available here: https://gist.github.com/tiernano/8217968

I have 3 connections myself (2@200mb/10mb and 1 @70/20). this is done as follows:

https://gist.github.com/tiernano/8218016

If you have any questions, give me a shout. I am planning on wiriting up a proper explanation of how this works eventually...
Hi and Thank you for this post
I have a problem with PCC.
We have 4 unequal WAN connection from different ISPs. I config our RB2011U for PCC loadBalancing according to the MikroTik website article (http://wiki.mikrotik.com/wiki/Manual:PCC) and everything is good.
But I have 2 questions :
How can I route the traffic of a specific host (192.168.1.50) from LAN to WAN1 link forever?
How can I force FTP traffic go through WAN2 link and use WAN3 link as failover link?
This is my config:
/interface
set name=LAN numbers=5
set name=WAN1 numbers=6
set name=WAN2 numbers=7
set name=WAN3 numbers=8
set name=WAN4 numbers=9
/ip address
add address=192.168.1.1/24 network=192.168.1.0 broadcast=192.168.1.255 interface=LAN
add address=10.10.10.1/29 network=10.10.10.0 broadcast=10.10.10.7 interface=WAN1
add address=10.10.20.1/29 network=10.10.20.0 broadcast=10.10.20.7 interface=WAN2
add address=10.10.30.1/29 network=10.10.30.0 broadcast=10.10.30.7 interface=WAN3
add address=10.10.40.1/29 network=10.10.40.0 broadcast=10.10.40.7 interface=WAN4
/ip firewall mangle
add chain=input in-interface=WAN1 action=mark-connection new-connection-mark=WAN1_Connection
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_Connection 
add chain=input in-interface=WAN3 action=mark-connection new-connection-mark=WAN3_Connection 
add chain=input in-interface=WAN4 action=mark-connection new-connection-mark=WAN4_Connection 
add chain=output connection-mark=WAN1_Connection action=mark-routing new-routing-mark=Route_To_WAN1 
dd chain=output connection-mark=WAN2_Connection action=mark-routing new-routing-mark=Route_To_WAN2 
add chain=output connection-mark=WAN3_Connection action=mark-routing new-routing-mark=Route_To_WAN3 
add chain=output connection-mark=WAN4_Connection action=mark-routing new-routing-mark=Route_To_WAN4 
add chain=prerouting in-interface=LAN dst-address=10.10.20.0/29 action=accept 
add chain=prerouting in-interface=LAN dst-address=10.10.30.0/29 action=accept
add chain=prerouting in-interface=LAN dst-address=10.10.40.0/29 action=accept 
add chain=prerouting in-interface=LAN dst-address=10.10.50.0/29 action=accept 

add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/0 action=mark-connection new-connection-mark=WAN1_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/1 action=mark-connection new-connection-mark=WAN1_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/2 action=mark-connection new-connection-mark=WAN1_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/3 action=mark-connection new-connection-mark=WAN1_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/4 action=mark-connection new-connection-mark=WAN2_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/5 action=mark-connection new-connection-mark=WAN2_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/6 action=mark-connection new-connection-mark=WAN2_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/7 action=mark-connection new-connection-mark=WAN2_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/8 action=mark-connection new-connection-mark=WAN3_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/9 action=mark-connection new-connection-mark=WAN3_Connection passthrough=yes 
add chain=prerouting dst-address-type=!local in-interface=LAN per-connection-classifier=both-addresses-and-ports:11/10 action=mark-connection new-connection-mark=WAN4_Connection passthrough=yes

add chain=prerouting connection-mark=WAN1_Connection in-interface=LAN action=mark-routing new-routing-mark=Route_To_WAN1
add chain=prerouting connection-mark=WAN2_Connection in-interface=LAN action=mark-routing new-routing-mark=Route_To_WAN2
add chain=prerouting connection-mark=WAN3_Connection in-interface=LAN action=mark-routing new-routing-mark=Route_To_WAN3
add chain=prerouting connection-mark=WAN4_Connection in-interface=LAN action=mark-routing new-routing-mark=Route_To_WAN4

/ip route
add dst-address=0.0.0.0/0 routing-mark=Route_To_WAN1 gateway=10.10.10.6 check-gateway=ping 
add dst-address=0.0.0.0/0 routing-mark=Route_To_WAN2 gateway=10.10.20.6 check-gateway=ping
add dst-address=0.0.0.0/0 routing-mark=Route_To_WAN3 gateway=10.10.30.6 check-gateway=ping 
add dst-address=0.0.0.0/0 routing-mark=Route_To_WAN4 gateway=10.10.40.6 check-gateway=ping 

add dst-address=0.0.0.0/0 gateway=10.10.10.6 distance=1 check-gateway=ping 
add dst-address=0.0.0.0/0 gateway=10.10.20.6 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.10.30.6 distance=3 check-gateway=ping 
add dst-address=0.0.0.0/0 gateway=10.10.40.6 distance=4 check-gateway=ping 

/ip firewall nat
add chain=srcnat out-interface=WAN1 action=masquerade
add chain=srcnat out-interface=WAN2 action=masquerade
add chain=srcnat out-interface=WAN3 action=masquerade
add chain=srcnat out-interface=WAN4 action=masquerade
Sadegh.Nakhjavani@GMail.com
 
User avatar
tpfresh
just joined
Posts: 22
Joined: Tue Jun 10, 2014 9:59 am
Location: Thailand
Contact:

Re: Best load balancing method for 4 WAN links

Wed Dec 17, 2014 12:30 pm

Hi ALL

i reading your Load balance Bandwidth base Method(MUM_US12)
http://mum.mikrotik.com/presentations/US12/tomas.pdf
but i don't understand this
i connect internet by PPPoe-Client(pppoe-out1,2,3) and I have to do anything at this stage ?
thank you
/ipfirewall address-list
addaddress=1.1.1.0/24 list=Connected
addaddress=2.2.2.0/24 list=Connected
addaddress=192.168.22.0/24 list=Connected
addaddress=192.168.22.0/24 list=LAN
/ipfirewall mangle
addchain=preroutingsrc-address-list=Connected
dst-address-list=Connected action=accept
Last edited by tpfresh on Wed Dec 17, 2014 3:27 pm, edited 2 times in total.
 
User avatar
nick3dos
Member Candidate
Member Candidate
Posts: 189
Joined: Fri Apr 29, 2011 11:03 pm
Location: Greece

Re: Best load balancing method for 4 WAN links

Wed Dec 17, 2014 1:10 pm

 
User avatar
tpfresh
just joined
Posts: 22
Joined: Tue Jun 10, 2014 9:59 am
Location: Thailand
Contact:

Re: Best load balancing method for 4 WAN links

Wed Dec 17, 2014 3:30 pm

Thank you nick3dos but not it i mean it is PCC not Bandwidth base
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: Best load balancing method for 4 WAN links

Wed Dec 17, 2014 3:34 pm

Hi ALL

i reading your Load balance Bandwidth base Method(MUM_US12)
http://mum.mikrotik.com/presentations/US12/tomas.pdf
but i don't understand this
i connect internet by PPPoe-Client(pppoe-out1,2,3) and I have to do anything at this stage ?
thank you
/ipfirewall address-list
addaddress=1.1.1.0/24 list=Connected
addaddress=2.2.2.0/24 list=Connected
addaddress=192.168.22.0/24 list=Connected
addaddress=192.168.22.0/24 list=LAN
/ipfirewall mangle
addchain=preroutingsrc-address-list=Connected
dst-address-list=Connected action=accept
If using PPPoE, add only your LAN's subnet into the "Connected" address-list.
 
User avatar
tpfresh
just joined
Posts: 22
Joined: Tue Jun 10, 2014 9:59 am
Location: Thailand
Contact:

Re: Best load balancing method for 4 WAN links

Wed Dec 17, 2014 6:18 pm

thank you tomaskir

i try to contact you in facebook & email in article :(
i meet this topic in seartch by google keyword "mikrotik load balance bandwidth base tomas" :lol: :lol:
 
mrkempis
just joined
Posts: 3
Joined: Fri Sep 05, 2014 5:23 pm

Re: Best load balancing method for 4 WAN links

Thu Dec 18, 2014 2:52 pm

any tips on how to mark the packet using sir tomas bandwidth based load balance
 
User avatar
tpfresh
just joined
Posts: 22
Joined: Tue Jun 10, 2014 9:59 am
Location: Thailand
Contact:

Re: Best load balancing method for 4 WAN links

Sat Dec 20, 2014 7:35 am

hi tomaskir

i have a question but if i have internet 3 line ? in your LB bandwidth based method
i must set in tool--> Traffic monitor ?
if it have 2 internet line ok i understand

but 3 internet line How should I set up?

10MB x 10MB x 10MB


Thank you :D

Who is online

Users browsing this forum: LouisdeBussy and 38 guests