my routeOS setting like this,,,my clients can't use internet ,do i have some things wrong ,please help me,,,thanks,,,
sorry i wrote some things wrong ,,i have changed it ,,thx all ,,please help me again ^-^
I have 3 isp want to make load balancing .....
my gateways is
GW-wan1=172.30.40.50
GW-wan2=172.30.30.30
GW-wan3=172.30.60.30
my wan address
wan1=172.30.40.51
wan2=172.30.30.31
wan3=172.30.60.31
my local 172.17.0.0/16
my lan ip 172.17.77.2
before i use this rule,,,for my client,,,
/ip firewall nat
add Chain=srcnat Src-Address 192.168.0.0/16 Action=masquerade
/ip firewall mangle
add chain=prerouting src-address=192.168.0.1/16 Action=mark routing New-Routing-Mark=1
add chain=prerouting src-address=192.168.0.2/16 Action=mark routing New-Routing-Mark=2
add chain=prerouting src-address=192.168.0.3/16 Action=mark routing New-Routing-Mark=3
Now i want to use nth to load balancing ...
from here i learn to set
so i set my Nth=2,3,0..1..2Nth
From MikroTik Wiki
Jump to: navigation, search
example: nth=Every,Counter,Packet nth=2,3,0. 2,3,1 2,3,2
divide all packets into groups of three (2+1). The packets will be numbered from 0 to 2. So, a sequence of packets the rule matches looks like: (0 1 2)(0 1 2)(0 1 2)(0 1 2)(0 1 2)...
the first rule will match the first packet in each group ("Packet"=0). The second rule will match the second packet in each group ("Packet"=1) and so on. Each successful match increments the counter. When a value of "Every" is reached, the counter is reset to 0. For this to work, the "Counter" should be the same for all rules (you can pick any value from 0 to 15, IIRC).
i still have questions,,,how to set the counter ? it need set like every+1 ?
Egycom said
i didnt read all your configuration, however you should change NTH to ( nth=2,1,0 , nth=2,1,1 , nth=2,1,2)
My configure is:
/ ip address
add address=172.17.77.2/24 network=172.17.77.0 broadcast=172.17.77.255 interface=Lan
add address=172.30.40.51/24 network=172.30.40.0 broadcast=172.30.40.255 interface=Wan1
add address=172.30.30.31/24 network=172.30.30.0 broadcast=172.30.30.255 interface=Wan2
add address=172.30.60.31/24 network=172.30.60.0 broadcast=172.30.60.255 interface=Wan3
/ ip firewall mangle
add chain=prerouting src-address-list=1 in-interface=Lan action=mark-connection new-connection-mark=1 passthrough=yes
add chain=prerouting src-address-list=1 in-interface=Lan action=mark-routing new-routing-mark=1
add chain=prerouting src-address-list=2 in-interface=Lan action=mark-connection new-connection-mark=2 passthrough=yes
add chain=prerouting src-address-list=2 in-interface=Lan action=mark-routing new-routing-mark=2
add chain=prerouting src-address-list=3 in-interface=Lan action=mark-connection new-connection-mark=3 passthrough=yes
add chain=prerouting src-address-list=3 in-interface=Lan action=mark-routing new-routing-mark=3
add chain=prerouting in-interface=Lan connection-state=new nth=2,3,0 action=mark-connection new-connection-mark=1 passthrough=yes
add chain=prerouting in-interface=Lan action=add-src-to-address-list address-list=1 address-list-timeout=1d connection-mark=1 passthrough=yes
add chain=prerouting in-interface=Lan connection-mark=1 action=mark-routing new-routing-mark=1 passthrough=no
add chain=prerouting in-interface=Lan connection-state=new nth=2,3,1 action=mark-connection new-connection-mark=2 passthrough=yes
add chain=prerouting in-interface=Lan action=add-src-to-address-list address-list=2 address-list-timeout=1d connection-mark=2 passthrough=yes
add chain=prerouting in-interface=Lan connection-mark=2 action=mark-routing new-routing-mark=2 passthrough=no
add chain=prerouting in-interface=Lan connection-state=new nth=2,3,2 action=mark-connection new-connection-mark=3 passthrough=yes
add chain=prerouting in-interface=Lan action=add-src-to-address-list address-list=3 address-list-timeout=1d connection-mark=3 passthrough=yes
add chain=prerouting in-interface=Lan connection-mark=3 action=mark-routing new-routing-mark=3 passthrough=no
/ ip firewall nat
add chain=srcnat connection-mark=1 action=src-nat to-addresses=172.30.40.51 to-ports=0-65535
add chain=srcnat connection-mark=2 action=src-nat to-addresses=172.30.30.31 to-ports=0-65535
add chain=srcnat connection-mark=3 action=src-nat to-addresses=172.30.60.31 to-ports=0-65535
/ ip route
add dst-address=0.0.0.0/0 gateway=172.30.40.50 scope=255 target-scope=10 routing-mark=1
add dst-address=0.0.0.0/0 gateway=172.30.30.30 scope=255 target-scope=10 routing-mark=2
add dst-address=0.0.0.0/0 gateway=172.30.60.30 scope=255 target-scope=10 routing-mark=3
add dst-address=0.0.0.0/0 gateway=172.30.40.50 scope=255 target-scope=10