On trying to implement the Load Balance example in Wiki with 4 lines, I cannot copy/paste text as the ‘Nth=1,1,1’ gives error ‘Integer value needed’ (ROS3.3)
So I’m just punching in manually from Winbox.
what does the 1,1,1 or 1,1,0 stand for
What must I punch in to WinBox under Nth?
Is it for
WAN1: every=3, packet=0
WAN2: every=3, packet=1
WAN3: every=3, packet=2
WAN4: every=3, packet=3
Just to make sure, when wanting to Load Balance between 4 marks, would the 4 rules then be:
WAN1: every=4, packet=1
WAN2: every=3, packet=1
WAN3: every=2, packet=1
WAN4: every=1, packet=1(or just whatever is left)
If passthrough=no then each rule should get 25% of traffic?
I’ve try it, but somehow the connection will focus on 1 line 1st then if the 1st full then it hop to another line!! It’s different from MT 2,9 the connection in the same time will share the connection as mention 25% each then when we downloading a file the full bandwidth will reserved for us!
so first rule takes away correct 25%
second rule takes away 33.33(3)% that is same 25% of starting traffic etc.
edit:
in version 2.9 if you used nth then you had to have rules for traffic to cover every package of interest to work while in V3. you can have one rule that will do something with 1/8 of traffic and you do not have to care about rest 7/8
Ok, thank you. So
WAN1: every=4, packet=1
WAN2: every=3, packet=1
WAN3: every=2, packet=1
WAN4: every=1, packet=1(or just whatever is left)
is workin fine to LB 4 WANs but port 443 sites still gave trouble, so I added a rule before these to mark all traffic to port 443 with marker for WAN4. Now all SSL traffic goes through WAN4 and so far so good. Rest is balanced. Would like to have been able to balance 443 traffic as well…
I have a question…!!! I need to bypass the load balancing for specific traffic, example rapidshare traffic … I have an address list and I want to route the traffic by one gateway if destination IP is in the list…
Can anybody help me??? Thanks.
I understand that one should share connections in order to accomplish load balancing… instead of sharing packets.
Can one share packets to implement LB? Is it correct?
======================================
Can one use this below?
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=AAA nth=3,1 passthrough=yes; # will carry 100% of the connections
add action=mark-connection chain=prerouting new-connection-mark=BBB nth=3,2 passthrough=yes; # will carry 100% of the connections
add action=mark-connection chain=prerouting new-connection-mark=CCC nth=3,3 passthrough=yes; # will carry 100% of the connections
I changed from the WIKI example… ==> from mark-packet to mark-connection
=======================================
I understood that: Every rule has its own counter.
Then… from the WIKI example.. again.. may I use this way below?
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=AAA nth=3,1 passthrough=no; # will carry 100% of the connections
add action=mark-connection chain=prerouting new-connection-mark=BBB nth=2,1 passthrough=no; # will carry 67% of the connections
add action=mark-connection chain=prerouting new-connection-mark=CCC ; # will carry 33% of the connections
Again… changed from “mark-packet” to “mark-connection”.
if you mark packets only you might break some communication due to packet from other source will simple be dropped (if you have NAT) ssh wont work etc. so you mark connections and then mark packets to what connections they belong.
I appreciate if you correct my rules above regarding the tables mangle, nat and route.
If OK please write OK… and if not… please write the correct way/rule… please.
In the mangle table… I mark packet and routing information over existing connection before “passthrough=no”
In the nat table… I sourceNAT using packet mark instead of connection mark information.
then you can mark every other new connections as you wish with nth=2,1 and for the 3rd mark you can simply make rule without nth field set, so less to compare, less strain on CPU
i haven’t tested it in real, but it should work somehow if you correct this error.
also if it does not work you have to check out what interfaces it is going out and mark according to interfaces, because incoming traffic also will be natted if you do like you do it now.
then you can mark every other new connections as you wish with nth=2,1 and for the 3rd mark you can simply make rule without nth field set, so less to compare, less strain on CPU