Community discussions

MikroTik App
 
Cartman
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Wed Jul 23, 2008 6:14 pm

Load balancing

Thu May 16, 2013 5:02 pm

Hello world !!!

I have some problems with my load balancing script based on the script taken from http://www.adeelkml.tk.

My version :
ether3 : local interface
89.xxx.yyy.zzz : pppoe-dsl
89.xxx.yyy.zzz+1 : pppoe-dsl2

/ip firewall mangle

add action=mark-connection chain=prerouting comment=XXX connection-state=new disabled=no in-interface=ether3 new-connection-mark=conn1 nth=2,1 passthrough=yes
add action=mark-routing chain=prerouting comment=XXX connection-mark=conn1 disabled=no in-interface=ether3 new-routing-mark=conn1 passthrough=no
add action=mark-connection chain=prerouting comment=XXX connection-state=new disabled=no in-interface=ether3 new-connection-mark=conn2 nth=1,1 passthrough=yes
add action=mark-routing chain=prerouting comment=XXX connection-mark=conn2 disabled=no in-interface=ether3 new-routing-mark=conn2 passthrough=no

/ip firewall nat

add action=masquerade chain=srcnat comment=XXX connection-mark=conn1 disabled=no out-interface=pppoe-dsl
add action=masquerade chain=srcnat comment=XXX connection-mark=conn2 disabled=no out-interface=pppoe-dsl2

/ip route

add comment=XXX disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-dsl2 routing-mark=conn1 scope=255 target-scope=10
add comment=XXX disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-dsl routing-mark=conn2 scope=255 target-scope=10

The whole thing seems to work in a way, but it does not really an equivalent load balancing.
DSL1 has about 5-10 times as much traffic as DSL2 and the complete bandwidth is far below the possible value.
Both lines are 16 Mbit/s, but DSL1 cuts at 8Mbit/s, DSL2 at about 1.5 Mbit.

Does anybody have a hint for a solution ?

THX
 
User avatar
cbrown
Trainer
Trainer
Posts: 1842
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Re: Load balancing

Sun May 19, 2013 3:37 pm

C.Brown

cbrown[at]cbrown.co
Telegram: @chris4brown
MTCNA - MTCRE - MTCWE - MTCTCE
MTCSE - TRAINER-0179
 
nishadul
Member Candidate
Member Candidate
Posts: 155
Joined: Thu Dec 13, 2012 12:04 pm
Location: Bangladesh

Re: Load balancing [2 ISP = 1 LAN]

Mon May 20, 2013 6:53 am

 
User avatar
aacable
Member
Member
Posts: 434
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: Load balancing

Mon May 20, 2013 11:03 am

Hello world !!!

I have some problems with my load balancing script based on the script taken from http://www.adeelkml.tk.
My version :
 
ether3 : local interface / 89.xxx.yyy.zzz : pppoe-dsl /89.xxx.yyy.zzz+1 : pppoe-dsl2

/ip firewall mangle
add action=mark-connection chain=prerouting comment=XXX connection-state=new disabled=no in-interface=ether3 new-connection-mark=conn1 nth=2,1 passthrough=yes
add action=mark-routing chain=prerouting comment=XXX connection-mark=conn1 disabled=no in-interface=ether3 new-routing-mark=conn1 passthrough=no
add action=mark-connection chain=prerouting comment=XXX connection-state=new disabled=no in-interface=ether3 new-connection-mark=conn2 nth=1,1 passthrough=yes
add action=mark-routing chain=prerouting comment=XXX connection-mark=conn2 disabled=no in-interface=ether3 new-routing-mark=conn2 passthrough=no

/ip firewall nat
add action=masquerade chain=srcnat comment=XXX connection-mark=conn1 disabled=no out-interface=pppoe-dsl
add action=masquerade chain=srcnat comment=XXX connection-mark=conn2 disabled=no out-interface=pppoe-dsl2
The whole thing seems to work in a way, but it does not really an equivalent load balancing.
DSL1 has about 5-10 times as much traffic as DSL2 and the complete bandwidth is far below the possible value. Both lines are 16 Mbit/s, but DSL1 cuts at 8Mbit/s, DSL2 at about 1.5 Mbit.
Does anybody have a hint for a solution ?
THX
I can assure you that if you use NTH method (which is outdated), you will surely receive many complains from your clients about broken links, streaming stucking, authentication issues etc.

As CBROWN suggested, Use PCC which is way more stable and highly configurable to suite your requirements. either use src-address or other classifier, it will surely work much better then NTH.One benefit (among many) is that PCC can remember where does the previous packet from the "flow" went, and send the next packet the same way. You can identify flow by specifying set of options from src,dst addresses and ports etc.
_____________
Regard's

Syed Jahanzaib
Web: http://aacable.wordpress.com
Email: aacable [at] hotmail.com

Who is online

Users browsing this forum: No registered users and 43 guests