Load Balancing Mikrotik 2 Wan Metode NTH
Cara Setting Load Balancing Mikrotik 2 Wan Metode NTH
Kawan,
Selamat datang di jawaracloud.net :)
Kali ini saya akan share cara setting Load Balancing Mikrotik 2 ISP Metode NTH,
Modem-1 : First Media 10 Mbps
Modem-2 : Telkom Indihome 20 Mbps
Skenario / topologi jaringan yang saya terapkan kali ini adalah:
Modem 1 = 192.168.1.1/24 kita hubungkan ke ether1/PoE Mikrotik Modem 2 = 192.168.2.1/24 kita hubungkan ke ether2 Mikrotik LOCAL = 172.16.8.0/24 kita hubungkan ke ether3 Mikrotik
Setting interface dahulu agar script nth yang akan saya berikan nanti dapat bekerja sesuai harapan :)
/interface set name=WAN1 ether1 set name=WAN2 ether2 set name=LOCAL ether3
OK... set nama interface sudah, selanjutnya kita set ip address:
/ip address add address=192.168.1.2/24 interface=WAN1 add address=192.168.2.2/24 interface=WAN2 add address=172.16.8.1/24 interface=LOCAL
Lalu set DNS, disini saya menggunakan dns google 8.8.8.8 dan 8.8.4.4 karna WAN1 dan WAN2 berbeda ISP
/ip dns set servers=8.8.8.8,8.8.4.4 allow-remote-requests=yes max-udp-packet-size=512 cache-size=5000
Kemudian kita bikin Script NTH seperti yang saya bilang tadi, mohon hati-hati karna disinilah bagian inti dari setting NTH Mikrotik:
/ip firewall mangle add chain=prerouting in-interface=LOCAL connection-state=new nth=2,1 action=mark-connection new-connection-mark=koneksi-wan1 passthrough=yes add chain=prerouting in-interface=LOCAL connection-mark=koneksi-wan1 action=mark-routing new-routing-mark=to-wan1 passthrough=no add chain=prerouting in-interface=LOCAL connection-state=new nth=2,2 action=mark-connection new-connection-mark=koneksi-wan2 passthrough=yes add chain=prerouting in-interface=LOCAL connection-mark=koneksi-wan2 action=mark-routing new-routing-mark=to-wan2 passthrough=no
Selanjutnya kita setting gateway-1 dan gateway-2 sesuai dengan ip address modem pertama dan kedua:
/ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1 scope=255 target-scope=10 routing-mark=to-wan1 add dst-address=0.0.0.0/0 gateway=192.168.2.1 scope=255 target-scope=10 routing-mark=to-wan2
Terakhir, kita setting nat agar jaringan local / client dapat terkoneksi ke internet :
/ip firewall nat add action=masquerade chain=srcnat disabled=no src-address=172.16.8.0/24