load balancing for my dual adsl

me to be lazy and ask some one to do it for me for who has sucessfully got it to work, i have 2 adsl lines possibly more if MT will work at all, there are 3 known methods that would worf for me:
Session
Weight round robin
Dymamic Traffic

I dont mind at all which of them they generaly create the same output
very fast speed when using download managers.

Dan.

is this an auction?

I’ll pay 500$ if someone can get Load balencing working properly…i dont think it can be done with the current route OS

really.

joe

It works fine for me … however it might be that I’m not using NAT. We load balance 2 gigabit connections without problems.

For simple outbound load balancing just add both gateway IPs to your default route. If you want to start sending specific traffic out one gateway only you start getting into policy routing - but once its done it works fine.

So many people ask this question and for some reason can never figure it out. One of these days I will post a wiki with a few setups that I’ve got working - not that much time at the moment though - fighting bgp issues with MT : )

Sam

Ok well i guess thats 600 dollars in tottal any takers? nat would be needed I would have thought. I have a dual wan netcomm nb750 router it only works with NAT. but its only 2 wan ports and its not a MT router.


so we have 600 dollars so far.

It can be done for multiple ADSL lines… You cann’t make all lines use exacly the same bandwidth.

example:
1-st ISP gateway: 192.168.0.1
2-nd ISP gateway: 192.168.2.1

/ip route add dst-address=0.0.0.0/0 gateway=192.168.0.1,192.168.2.1

2:1 balancing:

/ip route add dst-address=0.0.0.0/0 gateway=192.168.0.1,192.168.0.1,192.168.2.1

2 connections will be routed via 192.168.0.1, and the next one - via 192.168.2.1

It works fine for me (with one ADSL /2Mbit/ connection, and one CABLE modem connection /1.5Mbit/.)
Bulgarian telecom BTK sux…

The other simple way is to use routing-mark :slight_smile:
p.s.
http://www.mikrotik.com/docs/ros/2.9/ip/route

I tried this but when i use my threaded download manager 1 link only gets used. my whole plan is to use a download manager so when the second thread opens it most likly will be on the second wan port.
I cant explain why mine dont work, maybe it does partly but not very well at all, which brings me back to the original idea of a similar way the netcomm nb750 works it loads every new tcp session on a different wan port, OR it has option of link saturation, the netcomm actualy monitors sessions or link speed to change the route over to the other wan port with out breaeking downloads.

So what are we up to $600 dollars to whom will create this.

Hi,

this “Load balance two ADSL lines” have been discussed a lot in the forum up to now, and no one have ever posted a solution. It has even been discussed at the first MUM in Praha.

The problem is the session persistence. One session (like a IM session, a HTTPS session) must be handled by one WAN port. Otherwise the server on the other side will get confused if he gets requests from one client but over two WAN ports (with different WAN IPs/Gateways/Providers).

To create two default routes is no solution. We need a solution for NAT’ed WAN connections like two PPPoE connections.

See other postings:

http://forum.mikrotik.com/viewtopic.php?t=6461

http://forum.mikrotik.com/t/problem-with-http-downloads-via-loadbalanced-lines/5835/1

seandsl

Yes i know about the ssl with online banking my netcomm router can specify a perticular route for port 443 ssl connections thats is easy fixed IM is UDP i think i never have a problem with IM in any way but im sure it can be fixed if we bind the IM to a wan port.



So who wants this ?

Shouldn’t it be possible to create a mangle rule to mark new connections as line1 or line2..

Then create another mangle rule that marks all packets that match a connection mark of line1 or line2 with a routing mark of route1 and route2.

Then create a routing rule to send all traffic with a routing mark of route1 or route2 to the proper gateway?

I haven’t tested this so I don’t know if it will work.. Any ideas?
-Gerard

This would be an easy resolution with MLPPP support in Mikrotik…

Yes of coarse MLPPP but there is no ISP in australia that supports it although its still good to have that also.


So $600 dollars guys.

Eugene just made this and will post it in the wiki in a few minutes

http://wiki.mikrotik.com/wiki/Improved_Load_Balancing_over_Multiple_Gateways

So does that mean I get partial credit or something?
-Gerard

I translate the wiki article to spanish:
http://wiki.mikrotik.com/wiki/Balanceo_de_carga_mejorado_atravéz_de_multiples_gateway_(wan)


Maximiliano
Mikrotik Certified Consultant
To Sharing the knowledge

Great, just visit it after day or two to add latest updates and feedback.

Hey guys, thanks a lot, appreciated!

Now let’s talk the solution a bit. Never saw anything like that - even, odd packets, nice. So if I understand it correctly, the solution tries to equally divide traffic between two gateways, right?

You use one local interface. Is it possible to use single mangle rule, and instead of marking connection first, to decide upon source network address? Will that be sufficient?:

chain=prerouting src-address=10.0.0.0/24 action=mark-routing new-routing-mark=gw1 passthrough=no

chain=prerouting src-address=10.0.1.0/24 action=mark-routing new-routing-mark=gw2 passthrough=no

Routing is understandable, just NAT is not applied as yours, only upon outgoing interface, so not using connection-marks …

maybe mine aproach did not work properly, because of missing one default route for eventually not market packets …

Petr

Has anyone tested this? I have it working but its slightly diff from the wiki.. I had to add in 2 routing rules to make it lookup the correct table..

/ ip firewall mangle 
add chain=prerouting in-interface=ether2 connection-state=new nth=1,1,0 \
    action=mark-connection new-connection-mark=odd passthrough=yes comment="" \
    disabled=no 
add chain=prerouting in-interface=ether2 connection-mark=odd \
    action=mark-routing new-routing-mark=odd passthrough=no comment="" \
    disabled=no 
add chain=prerouting in-interface=ether2 connection-state=new nth=1,1,1 \
    action=mark-connection new-connection-mark=even passthrough=yes comment="" \
    disabled=no 
add chain=prerouting in-interface=ether2 connection-mark=even \
    action=mark-routing new-routing-mark=even passthrough=no comment="" \
    disabled=no 

/ ip firewall nat 
add chain=srcnat connection-mark=odd action=src-nat \
    to-addresses=192.168.10.201 to-ports=0-65535 comment="" disabled=no 
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.1.1.202 \
    to-ports=0-65535 comment="" disabled=no 

/ ip route 
add dst-address=0.0.0.0/0 gateway=192.168.10.1 scope=255 target-scope=10 \
    routing-mark=odd comment="" disabled=no 
add dst-address=0.0.0.0/0 gateway=10.1.1.254 scope=255 target-scope=10 \
    routing-mark=even comment="" disabled=no 

/ ip route rule 
add routing-mark=odd action=lookup table=odd comment="" disabled=no 
add routing-mark=even action=lookup table=even comment="" disabled=no

The problem with the setup discussed here is (could be) the following, if I’m not completely wrong:

For “normal” internet usage this will work. But it WILL eventually send out connections from the SAME user over DIFFERENT uplinks.
If you are now using a web application (like online banking, extranet, …), it might very well be (and that’s the way most of my online apps are coded) that for every action you take you login is checked for the source address.
That is, if you login in from source address 10.111.0.1 (to stay with the example addresses from the wiki), and one of your next requests is coming from 10.112.0.1, the app might consider that an attempt to spoof/hijack the session and will log you out (or do whatever the programmer intended to do).
Even “simply” using some webmail interface might show this problem.

And the solution in the wiki will NOT take care of that, as it is doing round-robin on every single connection(!).

I had done some tinkering around to get a solution that takes this into account, but never got around to testing thoroughly.

I will try to dig up my solution (which wasn’t perfect, either, of course) and put it up here for discussion…

I’m not trying to offend anyone here (especially not Eugene) - just want to point out to possible problems as I see them.

Best regards,
Christian Meis