Community discussions

MikroTik App
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Load Balancing

Fri Nov 11, 2011 11:03 am

Good day

I have setup load balancing with the following.

/ip address> print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 10.33.0.2/24 10.33.0.0 WAN1
1 10.34.0.2/24 10.34.0.0 WAN2
2 10.35.0.2/24 10.35.0.0 WAN3
3 100.10.0.1/24 100.10.0.0 LAN

/ip firewall mangle> print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=prerouting action=accept dst-address=10.33.0.0/24 in-interface=LAN

1 chain=prerouting action=accept dst-address=10.34.0.0/24 in-interface=LAN

2 chain=prerouting action=accept dst-address=10.35.0.0/24 in-interface=LAN

3 chain=prerouting action=accept dst-address=10.1.1.0/29 in-interface=LAN

4 chain=prerouting action=mark-connection new-connection-mark=WAN1_conn
passthrough=yes in-interface=WAN1 connection-mark=no-mark

5 chain=prerouting action=mark-connection new-connection-mark=WAN2_conn
passthrough=yes in-interface=WAN2 connection-mark=no-mark

6 chain=prerouting action=mark-connection new-connection-mark=WAN3_conn
passthrough=yes in-interface=WAN3 connection-mark=no-mark

7 chain=prerouting action=mark-connection new-connection-mark=WAN4_conn
passthrough=yes in-interface=WAN4 connection-mark=no-mark

8 chain=prerouting action=mark-connection new-connection-mark=WAN1_conn
passthrough=yes dst-address-type=!local in-interface=LAN
connection-mark=no-mark per-connection-classifier=both-addresses:4/0

9 chain=prerouting action=mark-connection new-connection-mark=WAN2_conn
passthrough=yes dst-address-type=!local in-interface=LAN
connection-mark=no-mark per-connection-classifier=both-addresses:4/1

10 chain=prerouting action=mark-connection new-connection-mark=WAN3_conn
passthrough=yes dst-address-type=!local in-interface=LAN
connection-mark=no-mark per-connection-classifier=both-addresses:4/2

11 chain=prerouting action=mark-connection new-connection-mark=WAN4_conn
passthrough=yes dst-address-type=!local in-interface=LAN
connection-mark=no-mark per-connection-classifier=both-addresses:4/3

12 chain=prerouting action=mark-routing new-routing-mark=to_WAN1
passthrough=yes in-interface=LAN connection-mark=WAN1_conn

13 chain=prerouting action=mark-routing new-routing-mark=to_WAN2
passthrough=yes in-interface=LAN connection-mark=WAN2_conn

14 chain=prerouting action=mark-routing new-routing-mark=to_WAN3
passthrough=yes in-interface=LAN connection-mark=WAN3_conn

15 chain=prerouting action=mark-routing new-routing-mark=to_WAN4
passthrough=yes in-interface=LAN connection-mark=WAN4_conn

16 chain=output action=mark-routing new-routing-mark=to_WAN1 passthrough=yes
connection-mark=WAN1_conn

17 chain=output action=mark-routing new-routing-mark=to_WAN2 passthrough=yes
connection-mark=WAN2_conn

18 chain=output action=mark-routing new-routing-mark=to_WAN3 passthrough=yes
connection-mark=WAN3_conn

19 chain=output action=mark-routing new-routing-mark=to_WAN4 passthrough=yes
connection-mark=WAN4_conn

/ip route> print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 0.0.0.0/0 10.33.0.1 1
1 A S 0.0.0.0/0 10.34.0.1 1
2 A S 0.0.0.0/0 10.35.0.1 1
3 A S 0.0.0.0/0 10.33.0.1 1
4 S 0.0.0.0/0 10.34.0.1 2
5 S 0.0.0.0/0 10.35.0.1 3
6 ADC 10.33.0.0/24 10.33.0.2 WAN1 0
7 ADC 10.34.0.0/24 10.34.0.2 WAN2 0
8 ADC 10.35.0.0/24 10.35.0.2 WAN3 0
9 ADC 100.10.0.0/24 100.10.0.1 LAN 0

/ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=srcnat action=masquerade out-interface=WAN1

1 chain=srcnat action=masquerade out-interface=WAN2

2 chain=srcnat action=masquerade out-interface=WAN3

3 chain=srcnat action=masquerade out-interface=WAN4

WAN 4 is no longer in use. I am able to reach the combined speeds of the 3 internet connections with a torrent program. However I am curious as to why WAN 2 and WAN 3 are not in Active state. In winbox they just appear blue as if unreachable.

Please may someone assist with a possible reason and check over my code. as far as i can see it is adequate.
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Load Balancing

Mon Nov 14, 2011 9:51 am

can anyone help with this pls :S
 
User avatar
cbrown
Trainer
Trainer
Posts: 1839
Joined: Thu Oct 14, 2010 8:57 pm
Contact:

Load Balancing

Mon Nov 14, 2011 5:07 pm

Because you are using the routes with routing marks and not the routes with the higher distance. It sounds like it is working right.
 
zimbofury
newbie
Topic Author
Posts: 48
Joined: Wed Nov 03, 2010 8:10 am

Re: Load Balancing

Tue Nov 15, 2011 9:55 am

Yes. It seems to be an ISP issue. the DSL lines give issues at random between each other. If say one connection is timing out, will the router still choose that path? is there a way to make the router check if the connection is stable or not and cut it off till it stabilizes?

Thanks in advance.

Who is online

Users browsing this forum: f008600, fibracapi and 72 guests