Nth LoadBalancing

I read Nth Balancing configuration and tried to implement it on my machine.

following are the details of my configuration.


/ ip address
add address=11.1.1.1/24 network=11.1.1.0 broadcast=11.1.1.255 interface=Lan
add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=wlan2
add address=192.168.2.2/24 network=192.168.2.0 broadcast=192.168.2.255 interface=wlan1

/ ip firewall mangle
add chain=prerouting src-address-list=odd in-interface=Lan action=mark-connection \ new-connection-mark=odd passthrough=yes
add chain=prerouting src-address-list=odd in-interface=Lan action=mark-routing \ new-routing-mark=odd passthrough=no
add chain=prerouting src-address-list=even in-interface=Lan action=mark-connection \ new-connection-mark=even passthrough=yes
add chain=prerouting src-address-list=even in-interface=Lan action=mark-routing \ new-routing-mark=even passthrough=no
add chain=prerouting in-interface=Lan connection-state=new nth=2,1 \ action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Lan action=add-src-to-address-list \ address-list=odd address-list-timeout=1d connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Lan connection-mark=odd action=mark-routing \ new-routing-mark=odd passthrough=no
add chain=prerouting in-interface=Lan connection-state=new nth=2,2 \ action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting in-interface=Lan action=add-src-to-address-list \ address-list=even address-list-timeout=1d connection-mark=even passthrough=yes
add chain=prerouting in-interface=Lan connection-mark=even action=mark-routing \ new-routing-mark=even passthrough=no

/ ip firewall nat
add chain=srcnat out-interface=wlan1 action=masquerade
add chain=srcnat out-interface=wlan2 action=masquerade

/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10 routing-mark=odd
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 routing-mark=even
add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10


net working on client pc through wlan2

but wlan1 not working at all even when i disconnect wlan2.

did i make any mistake?

Your first two mangle rules are marking all the connections, that is why traffic is routed only through wlan2.

thanks for reply.

please guide me in detail, how can i solve this problem to have loadbalancing.?

add chain=prerouting src-address-list=odd in-interface=Lan action=mark-connection \ new-connection-mark=odd passthrough=yes
add chain=prerouting src-address-list=odd in-interface=Lan action=mark-routing \ new-routing-mark=odd passthrough=no
add chain=prerouting src-address-list=even in-interface=Lan action=mark-connection \ new-connection-mark=even passthrough=yes
add chain=prerouting src-address-list=even in-interface=Lan action=mark-routing \ new-routing-mark=even passthrough=no

Remove those rules.

still unable to have loadbalancing.

I attached the digram of required configuration.

and details as follow

lan = 11.1.1.1/24

Modem 1 = 192.168.1.1 (pppoe) 2Mb

Modem 2 = 192.168.2.1 (pppoe) 2Mb

please guide me how users can use 4Mb downloading from both modems.
MT1.GIF