Question About Load Balancing

Dear All,

I have 4x PPPoE Clients each one on a LAN card,
and the 4 PPPoE(s) are from the same provider and having the same gateway.

How can i Load Balance between them ??

  • My RouterOS version is 4.4

Will be there any problems in Browsing , HTTPS , IM (Yahoo! Messenger) ??

YES you can :wink:

/ip firewall mangle
add action=mark-connection chain=prerouting comment=
“Mark every 2. new connection for pppoe-out1” connection-state=new disabled=no
in-interface=ether1 new-connection-mark=pppoe-out1 nth=2,1 passthrough=yes
add action=mark-routing chain=prerouting comment=
“Mark all packets in conn pppoe-out1 with routing mark pppoe-out1”
connection-mark=pppoe-out1 disabled=no in-interface=ether1
new-routing-mark=pppoe-out1 passthrough=no
add action=mark-connection chain=prerouting comment=
“Mark the rest of new connections for pppoe-out2” connection-state=new
disabled=no in-interface=ether1 new-connection-mark=pppoe-out2 nth=2,2
passthrough=yes
add action=mark-routing chain=prerouting comment=
“Mark all packets in conn pppoe-out2 with routing mark pppoe-out2”
connection-mark=pppoe-out2 disabled=no in-interface=ether1
new-routing-mark=pppoe-out2 passthrough=no

just add more pppoe-out3 and out4 :wink:


/ip route
0 A S 0.0.0.0/0 pppoe-out2 1
1 A S 0.0.0.0/0 pppoe-out1 1
2 A S 0.0.0.0/0 pppoe-out1 2
3 S 0.0.0.0/0 pppoe-out2 2
4 ADC 192.168.1.0/24 192.168.1.1 ether1 0

just add pppoe-out3 and 4 to route

/ip firewall nat
3 ;;; Masquerade interfaces
chain=srcnat action=masquerade out-interface=pppoe-out1

4 chain=srcnat action=masquerade out-interface=pppoe-out2

just add pppoe-out 3 and 4 to nat

and … it should work
Njoy

Search the forums for the PCC thread.

Will be there any problems in Browsing , HTTPS , IM (Yahoo! Messenger) ??

PCC will help to alleviate the problems.

Hello, I have the same doubt

Will PCC work correctly with two different WAN but from the same provider having the same Gateway? Also having the IP address in the same range if having the same gateway.

Because the WIKI (http://wiki.mikrotik.com/wiki/PCC) shows only balance with different gateways and IP address in different ranges.

if you use PP* (pptp, pppoe, etc) to connect to your provider - then just set ‘gateway=your-ppp-client’

if you use ethernet - then via CLI set ‘gateway=IP%Interface’ and don’t edit this route with WinBox (CLI only). in v3 you will need to install ‘routing-test’ package

Hi, thanks for the quick reply. I use static IP address, routerOS 3.30 and have the routing-test installed, but not the routing package, Do I need both?

Could you explain me a little more the CLI configuration? I want to understand what I am doing. I’ve never used “gateway=IP%Interface”

Thank you for your time.

yes, this syntax is available only in ‘routing-test’, not ‘routing’

for example, if you have two links to the provider (eth1 and eth2), and gateway addresses are the same (1.2.3.4), then you should add two routes, like

/ip routes add routing-mark=gw1 gateway=1.2.3.4%eth1
/ip routes add routing-mark=gw2 gateway=1.2.3.4%eth2

I see, because via winbox the gateway out interface is set automatically right?

WinBox removes ‘%interface’ part even if you simply disable that route. it’s still not ready for this )))

oh I thought it was the part that says “reachable ether2” next to the Gateway IP.

no, it simply points the router to the necessary interface

Ok, I will try the CLI configuration and let you know if I have any problem.

Thank you very much for your help and your time.

Chupaka, thanks for this information, but my 4 adsl WAN give me DHCP valid dinamic IP, sometimes 2 wan have the same gateway, sometimes not and sometimes 3 of them have the same gateway, it’s really the same provider but sometimes dont use the same gateway, how i can fight with this? thanks

omg! can somebody explain, how do they change gateway address on the fly? =)

lukkes, probably you need some scripting to detect GW changes…