Script Load Balance Mikrotik 2 Line WAN metode NTH
# Load Balancing Metode ->Â NTH
################################################
/ip firewall address-list
add address=192.168.0.0/16 list=LOCAL-IP comment=”LB By BNT”
add address=172.16.0.0/12 list=LOCAL-IP comment=”LB By BNT”
add address=10.0.0.0/8 list=LOCAL-IP comment=”LB By BNT”
/ip firewall nat
add chain=srcnat out-interface=”ether1” action=masquerade comment=”LB By BNT”
add chain=srcnat out-interface=”ether2” action=masquerade comment=”LB By BNT”
/ip route
add check-gateway=ping distance=1 gateway=”192.168.1.1” routing-mark=”to-ether1” comment=”LB By BNT”
add check-gateway=ping distance=1 gateway=”192.168.2.1” routing-mark=”to-ether2” comment=”LB By BNT”
add check-gateway=ping distance=1 gateway=”192.168.1.1” comment=”LB By BNT”
add check-gateway=ping distance=2 gateway=”192.168.2.1” comment=”LB By BNT”
/ip firewall mangle
add action=mark-connection chain=prerouting in-interface=”ether1” new-connection-mark=”cm-ether1” passthrough=yes comment=”LB By BNT”
add action=mark-connection chain=prerouting in-interface=”ether2” new-connection-mark=”cm-ether2” passthrough=yes comment=”LB By BNT”
add action=mark-routing chain=output connection-mark=”cm-ether1” new-routing-mark=”to-ether1” passthrough=yes comment=”LB By BNT”
add action=mark-routing chain=output connection-mark=”cm-ether2” new-routing-mark=”to-ether2” passthrough=yes comment=”LB By BNT”
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP new-connection-mark=”cm-ether1” passthrough=yes connection-state=new nth=2,1Â src-address-list=LOCAL-IP comment=”LB By BNT”
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP new-connection-mark=”cm-ether2” passthrough=yes connection-state=new nth=2,2Â src-address-list=LOCAL-IP comment=”LB By BNT”
add action=mark-routing chain=prerouting connection-mark=”cm-ether1” dst-address-list=!LOCAL-IP new-routing-mark=”to-ether1” passthrough=no src-address-list=LOCAL-IP comment=”LB By BNT”
add action=mark-routing chain=prerouting connection-mark=”cm-ether2” dst-address-list=!LOCAL-IP new-routing-mark=”to-ether2” passthrough=no src-address-list=LOCAL-IP comment=”LB By BNT”
Script Load Balance Mikrotik 2 Line WAN dengan Metode ECMP
# Load Balancing ECMP (Equal Cost Multi Path)
################################################
/ip firewall nat
add chain=srcnat out-interface=”ether1” action=masquerade comment=”LB By BNT”
add chain=srcnat out-interface=”ether2” action=masquerade comment=”LB By BNT”
/ip route
add check-gateway=ping distance=1 gateway=”192.168.11.1,192.168.12.1,,,,” comment=”LB By BNT”
add check-gateway=ping distance=1 gateway=”192.168.11.1” routing-mark=”to-ether1” comment=”LB By BNT”
add check-gateway=ping distance=1 gateway=”192.168.12.1” routing-mark=”to-ether2” comment=”LB By BNT”
/ip firewall mangle
add action=mark-connection chain=input in-interface=”ether1” new-connection-mark=”cm-ether1” comment=”LB By BNT”
add action=mark-connection chain=input in-interface=”ether2” new-connection-mark=”cm-ether2” comment=”LB By BNT”
add action=mark-routing chain=output connection-mark=”cm-ether1” new-routing-mark=”to-ether1” comment=”LB By BNT”
add action=mark-routing chain=output connection-mark=”cm-ether2” new-routing-mark=”to-ether2” comment=”LB By BNT”
Membuat Script mandiri sesuai Topologi Jaringan Mikrotik anda…? silahkan kunjungi website berikut untuk membuat script nya: