Load Balancing Mikrotik with 2 Line Speedy


Berikut scripting Load Balancing dengan konfigurasi 2 Line Speedy untuk Mikrotik versi 2.9.27

Sesuaikan IP masing-masing interface menurut network kalian.

/ ip address
add address=192.168.0.10/24 network=192.168.0.0 broadcast=192.168.0.255 \
interface=local comment=”” disabled=no
add address=192.168.1.10/24 network=192.168.1.0 broadcast=192.168.1.255 \
interface=”Speedy 1″ comment=”” disabled=no
add address=192.168.2.10/24 network=192.168.2.0 broadcast=192.168.2.255 \
interface=”Speedy 2″ comment=”” disabled=no

/ ip firewall mangle

add chain=prerouting in-interface=local connection-state=new nth=1,1,0 \
action=mark-connection new-connection-mark=speedy1 passthrough=yes \
comment=”Load Balancing Client” disabled=no
add chain=prerouting in-interface=local connection-mark=speedy1 \
action=mark-routing new-routing-mark=speedy1 passthrough=no comment=”” \
disabled=no
add chain=prerouting in-interface=local connection-state=new nth=1,1,1 \
action=mark-connection new-connection-mark=speedy2 passthrough=yes \
comment=”” disabled=no
add chain=prerouting in-interface=local connection-mark=speedy2 \
action=mark-routing new-routing-mark=speedy2 passthrough=no comment=”” \
disabled=no

/ ip firewall nat
add chain=srcnat out-interface=”Speedy 1″ action=masquerade comment=”” \
disabled=no
add chain=srcnat out-interface=”Speedy 2″ action=masquerade comment=”” \
disabled=no

/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.254 scope=255 target-scope=10 \
routing-mark=speedy1 comment=”” disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.2.254 scope=255 target-scope=10 \
routing-mark=speedy2 comment=”” disabled=no
add dst-address=0.0.0.0/0 gateway=192.168.1.254 scope=255 target-scope=10 \
comment=”primary connection” disabled=no