Load balancing multiple same subnet links with daily limits

http://wiki.mikrotik.com/wiki/Manual:Load_balancing_multiple_same_subnet_links

I’m going to use that to load balance over 6 satellite links each having a daily bandwidth limit of 650MB. Each modem gives you the IP 192.168.0.2 and has a gateway of 192.168.0.1 which makes most load balancers unable to do the job. I am thinking of running a virtual machine behind the router so I can use the API to enable/disable links in the load balancer when they go over their 650MB limit. is the API capable of this?

For each link you can do static routes with 1.1.1.1%wan1 like this

192.168.0.1%wan1 routing-mark=towan1

192.168.0.1%wan2 routing-mark=towan2

192.168.0.1%wan3 routing-mark=towan3

With a script you can read the traffic of each wan and disable the route for this wan.

Send from my mobile phone using Tapatalk.

Any errors below?

/ ip address
add address=192.168.0.2/24 network=192.168.0.0 broadcast=192.168.0.255 interface=ether2
add address=192.168.0.2/24 network=192.168.0.0 broadcast=192.168.0.255 interface=ether3
add address=192.168.0.2/24 network=192.168.0.0 broadcast=192.168.0.255 interface=ether4
add address=192.168.0.2/24 network=192.168.0.0 broadcast=192.168.0.255 interface=ether5
add address=192.168.0.2/24 network=192.168.0.0 broadcast=192.168.0.255 interface=ether6
add address=192.168.0.2/24 network=192.168.0.0 broadcast=192.168.0.255 interface=ether7

add address=192.168.88.1/24 network=192.168.88.0 broadcast=192.168.88.255 interface=ether1
 
/ ip firewall mangle
add chain=prerouting dst-address=192.168.0.0/24 action=accept in-interface=ether1
 
add chain=prerouting in-interface=ether2 connection-mark=no-mark action=mark-connection new-connection-mark=hughes1
add chain=prerouting in-interface=ether3 connection-mark=no-mark action=mark-connection new-connection-mark=hughes2
add chain=prerouting in-interface=ether4 connection-mark=no-mark action=mark-connection new-connection-mark=hughes3
add chain=prerouting in-interface=ether5 connection-mark=no-mark action=mark-connection new-connection-mark=hughes4
add chain=prerouting in-interface=ether6 connection-mark=no-mark action=mark-connection new-connection-mark=hughes5
add chain=prerouting in-interface=ether7 connection-mark=no-mark action=mark-connection new-connection-mark=hughes6

add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:6/0 action=mark-connection new-connection-mark=hughes1
add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:6/1 action=mark-connection new-connection-mark=hughes2
add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:6/2 action=mark-connection new-connection-mark=hughes3
add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:6/3 action=mark-connection new-connection-mark=hughes4
add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:6/4 action=mark-connection new-connection-mark=hughes5
add chain=prerouting in-interface=ether1 connection-mark=no-mark dst-address-type=!local per-connection-classifier=both-addresses:6/5 action=mark-connection new-connection-mark=hughes6
 
add chain=prerouting connection-mark=hughes1 in-interface=ether1 action=mark-routing new-routing-mark=tohughes1
add chain=prerouting connection-mark=hughes2 in-interface=ether1 action=mark-routing new-routing-mark=tohughes2
add chain=prerouting connection-mark=hughes3 in-interface=ether1 action=mark-routing new-routing-mark=tohughes3
add chain=prerouting connection-mark=hughes4 in-interface=ether1 action=mark-routing new-routing-mark=tohughes4
add chain=prerouting connection-mark=hughes5 in-interface=ether1 action=mark-routing new-routing-mark=tohughes5
add chain=prerouting connection-mark=hughes6 in-interface=ether1 action=mark-routing new-routing-mark=tohughes6

add chain=output connection-mark=hughes1 action=mark-routing new-routing-mark=tohughes1
add chain=output connection-mark=hughes2 action=mark-routing new-routing-mark=tohughes2
add chain=output connection-mark=hughes3 action=mark-routing new-routing-mark=tohughes3
add chain=output connection-mark=hughes4 action=mark-routing new-routing-mark=tohughes4
add chain=output connection-mark=hughes5 action=mark-routing new-routing-mark=tohughes5
add chain=output connection-mark=hughes6 action=mark-routing new-routing-mark=tohughes6

 
/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether2 routing-mark=tohughes1
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether3 routing-mark=tohughes2
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether4 routing-mark=tohughes3
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether5 routing-mark=tohughes4
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether6 routing-mark=tohughes5
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether7 routing-mark=tohughes6
 
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether2 distance=1
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether3 distance=1
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether4 distance=1
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether5 distance=1
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether6 distance=1
add dst-address=0.0.0.0/0 gateway=192.168.0.1%ether7 distance=1

/ ip firewall nat
add chain=srcnat out-interface=ether2 action=masquerade
add chain=srcnat out-interface=ether3 action=masquerade
add chain=srcnat out-interface=ether4 action=masquerade
add chain=srcnat out-interface=ether5 action=masquerade
add chain=srcnat out-interface=ether6 action=masquerade
add chain=srcnat out-interface=ether7 action=masquerade

I don’t know scripting for these routers is it similar to bash or something? Know of a similar script I can use a start?

How would I force one client on the LAN out a specific WAN?

Check my post in this thread. Use source IP (users IP address) instead of destination.

http://forum.mikrotik.com/t/static-route-to-an-ip-via-specific-wan-isp-when-using-pcc/73020/1