Community discussions

MikroTik App
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Multiple Gateway Load Balancing

Thu Mar 08, 2012 10:28 am

Good Day

I have a wireless network all controlled by OSPF and everything is running well.
MiktroTikHelp.png
I have multiple DSL lines all at different geographical locations that i would like to load balance my internet traffic over.

Please have a look at the picture and let me know if there is any way that i might be able to get this right?

http://wiki.mikrotik.com/wiki/Load_Bala ... e_Gateways
I have checked the link above but it only seems to help if you have more then one line connected to a single router.

Thank you in advance for any help you can give.
You do not have the required permissions to view the files attached to this post.
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Multiple Gateway Load Balancing

Thu Mar 08, 2012 3:12 pm

 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Re: Multiple Gateway Load Balancing

Thu Mar 08, 2012 8:28 pm

Please correct me if I am wrong but that requires me to have 2 interfaces on a single router that are connected to the net.

I have one interface that bring in 2 separate connections to the net and then a 3rd one on a separate interface.

If i understood what that link was saying then I should be able to balance between only 2 of my lines that come in on separate interfaces.

While it is a step in the right direction i'm not sure it's quite what i'm looking for.

Thank you very much for the reply.
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Multiple Gateway Load Balancing

Thu Mar 08, 2012 8:46 pm

What do the two DSL lines connect to before they come to your office? You could put each connection on a VLAN and then that would be your separate interface.
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Multiple Gateway Load Balancing

Fri Mar 09, 2012 6:58 am

Thank you for the idea I did not think about that. The 2 DSL lines are brought in wirelessly. Each one of the green lines in my picture is a wireless link and the black dots are my router.

Sorry I should have specified that in the beginning.

Thank you
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Multiple Gateway Load Balancing

Fri Mar 09, 2012 2:00 pm

No problem. I think your best bet is to use VLANs if you want separate interfaces.
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Re: Multiple Gateway Load Balancing

Fri Mar 09, 2012 4:07 pm

Sorry but it think I'm not understanding Vlans correctly.

I have updated my picture so you might have a bit of a better understanding.

I have a completely routed network that is across wireless.

Would vlan work in this situation?

Thank you again for your help.
You do not have the required permissions to view the files attached to this post.
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Multiple Gateway Load Balancing

Fri Mar 09, 2012 4:36 pm

Nope it sure won't. You could use EoIP.
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Multiple Gateway Load Balancing

Fri Mar 09, 2012 5:52 pm

I have a pptp server running on my HO's RB1100 if I pptp'd from the routers at the DSL lines that would show up as an alternate interface. I could then load balance over them... Would that perhaps work?
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Multiple Gateway Load Balancing

Sat Mar 10, 2012 3:17 am

Yea. Why do you not want to use a tunnel?
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Multiple Gateway Load Balancing

Sat Mar 10, 2012 8:36 am

To be completely honest I don't know how to set one up. I have never used them. I have set up the pptp's are setup and working. All I need to do now is force all my traffic from my VoIP server through one link and if it fails move to a different one.
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: Multiple Gateway Load Balancing

Sat Mar 10, 2012 9:52 am

let us know if that works for you, we are trying out some other solutions but not conclusive yet.
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Multiple Gateway Load Balancing

Sat Mar 10, 2012 2:23 pm

It is surprising easy. Check out this link.

http://wiki.mikrotik.com/wiki/Manual:Interface/EoIP
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Re: Multiple Gateway Load Balancing

Mon Mar 12, 2012 9:16 am

Thank you for your help.

The EoIP seems like it could work but the only thing i see that is an issue is the fact that i have different ip ranges on my various networks that have the DSL lines attached to them. Not a major issue as i can just add an ip on the correct range to the router but i found that by just using PPTP clients at the DSl lines and a server (that was already running) on my HO RB1100 I am able to load balance the traffic extremely well.

Thank you for your help with the idea.

Maybe you can help me with something else i am now having issues with. Since i started load balancing my traffic I am having issues with my VOIP exchange connecting to my service provider.

How can I force the traffic from my internal server (IP: 192.168.105.4) that is bound for my VOIP server (IP:41.xxx.xxx.xxx) through only one of my lines at a time?
I'm sure I must be able to mark packets in a mangle rule and then force it out an interface but i am unsure how to do it.

Thank you in advance for any help you can give.
 
CyberT
Member Candidate
Member Candidate
Posts: 172
Joined: Tue Feb 01, 2011 1:39 pm
Location: Johannesburg, South Africa
Contact:

Re: Multiple Gateway Load Balancing

Mon Mar 12, 2012 10:20 am

""I have a wireless network all controlled by OSPF and everything is running well.""

You could do one of the following,

let ospf offload trafic to the closest dsl line, this doesnt balance it as per say, but that does get you around a lot of trouble that you are going to run into.

the one issue that you have when using multiple adsl gateways is that you have a connection tracking issue, so if you want to use it in the even as you would like to use all the links at the same time from any location then you will have issues with secure sites, as the data could come from client - adsl1 - banking site then from client - adsl2 - banking site, this will just give you errors so then you need to track connections, this will mean that you need to push all your trafic to an TE/trafic manager, aka let everyone's 0/0 traffic head to one router, and that router will have equal cost paths to each AS-BORDER \ Def Gateway, that router will then have tunnels (eoip/mpls:vpls) this will create a equal cost to each ADSL GATEWAY, and you will have a routing table that will say dst-adress=0.0.0.0/0 gateway=10.1.1.1,10.1.2.1,10.1.3.1,10.1.2.4 for 4 dsl lines, that will give you the ability to get 40mb/s over 4 adsl lines, if you use a download manager, and all this will send 1 tcp-con-est to each possible gateway one after the other, then you need to track secure connections and make sure they either offload directly to the closest adsl or that you dedicate 1 line for secure, load balancing over adsl is an nice idea, but in practicality the best way to do it is with mlppp (mikrotik has support for this, but you isp needs to support) for this you will l2bride all your lines back to one router, and then from there dail an mlppp connection, this is the neatest way, and you can get 40mb/s via 4 lines with a single tcp-session.

are all the adsl lines from the same ISP?
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Multiple Gateway Load Balancing

Mon Mar 12, 2012 12:56 pm

How can I force the traffic from my internal server (IP: 192.168.105.4) that is bound for my VOIP server (IP:41.xxx.xxx.xxx) through only one of my lines at a time?
.
Are you wanting it to always go over the same DSL line, unless the line fails, then switch to another line or just keep the active connection going through the same line?
 
User avatar
Mohnki
just joined
Topic Author
Posts: 14
Joined: Wed Mar 23, 2011 7:48 pm

Re: Multiple Gateway Load Balancing

Mon Mar 12, 2012 5:22 pm

@ cbrown
I see the difference but am not sure personally with one would be better.

currently the setup seems to be tracking connections and then making sure that they go out through the same place they came in.
Here is the code for it.
/ ip firewall mangle
add chain=prerouting in-interface="Internet-Dale" connection-mark=no-mark action=mark-connection new-connection-mark=Dale_conn
add chain=prerouting in-interface="Internet-Richmond" connection-mark=no-mark action=mark-connection new-connection-mark=Richmond_conn
add chain=prerouting in-interface="Internet-Firestop" connection-mark=no-mark action=mark-connection new-connection-mark=Firestop_conn

add chain=prerouting  in-interface=Bridge connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:3/0 action=mark-connection new-connection-mark=Dale_conn 
add chain=prerouting  in-interface=Bridge connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:3/1 action=mark-connection new-connection-mark=Richmond_conn
add chain=prerouting  in-interface=Bridge connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:3/2 action=mark-connection new-connection-mark=Firestop_conn 

add chain=prerouting connection-mark=Dale_conn in-interface=Bridge action=mark-routing new-routing-mark=to_Dale
add chain=prerouting connection-mark=Richmond_conn in-interface=Bridge action=mark-routing new-routing-mark=to_Richmond
add chain=prerouting connection-mark=Firestop_conn in-interface=Bridge action=mark-routing new-routing-mark=to_Firestop

add chain=output connection-mark=Dale_conn action=mark-routing new-routing-mark=to_Dale    
add chain=output connection-mark=Richmond_conn action=mark-routing new-routing-mark=to_Richmond
add chain=output connection-mark=Firestop_conn action=mark-routing new-routing-mark=to_Firestop

/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.105.52 routing-mark=to_Dale check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.105.62 routing-mark=to_Richmond check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.105.58 routing-mark=to_Firestop check-gateway=ping

/ ip firewall nat 
add chain=srcnat out-interface="Internet-Dale" action=masquerade
add chain=srcnat out-interface="Internet-Richmond" action=masquerade
add chain=srcnat out-interface="Internet-Firestop" action=masquerade
Internet-Dale, Internet-Richmond and Internet-Firestop are my three incoming PPTP's ...

This setup works well ... Right up until what cyberT said.
Secure Banking sites break ...

I think if i understand this correctly I am tracking connections here?
I basically just used your link from earlier cbrown and made it work for me.

@CyberT
My lines are all through our south african DSL provider telkom. The accounts on those lines are all through a single provider aswell.
Please tell me if i am wrong but for mlppp i would need to EoIP tunnel to each router attached to the DSL Modems and then set up a mlppp. Is that about right?

The reason I am going with the load balancing is because everything comes to my central HO and then out from there and so a single line at a time is not only a waste but gets maxed out pretty quickly.

Please let me know what you guys think ...

Who is online

Users browsing this forum: No registered users and 25 guests