Community discussions

MikroTik App
 
areeb111
just joined
Topic Author
Posts: 14
Joined: Mon Sep 07, 2009 1:58 pm

Question About Load Balancing

Sat Jan 09, 2010 10:33 pm

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) ??
 
ffernandes
Member Candidate
Member Candidate
Posts: 148
Joined: Mon Jun 23, 2008 11:20 pm

Re: Question About Load Balancing

Sat Jan 09, 2010 10:59 pm

YES you can ;)

/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 ;)


/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
 
User avatar
butche
Trainer
Trainer
Posts: 428
Joined: Fri May 28, 2004 6:14 pm
Location: Missouri, USA
Contact:

Re: Question About Load Balancing

Sat Jan 09, 2010 11:48 pm

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 ??
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.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 1:36 pm

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.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 2:01 pm

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
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 2:45 pm

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.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 2:56 pm

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
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 3:22 pm

I see, because via winbox the gateway out interface is set automatically right?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 3:37 pm

WinBox removes '%interface' part even if you simply disable that route. it's still not ready for this )))
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 3:43 pm

oh I thought it was the part that says "reachable ether2" next to the Gateway IP.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 3:53 pm

no, it simply points the router to the necessary interface
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Question About Load Balancing

Thu Jan 28, 2010 4:15 pm

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.
 
lukkes
Member Candidate
Member Candidate
Posts: 177
Joined: Mon Jun 16, 2008 2:12 am
Location: Venezuela
Contact:

Re: Question About Load Balancing

Tue Feb 23, 2010 5:07 am

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

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
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Question About Load Balancing

Tue Feb 23, 2010 10:47 am

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

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

Who is online

Users browsing this forum: stef70 and 123 guests