Loadbalancing Mikrotik with PCC

Mungkin tanggal 3 febuari merupakan nasib kurang baik bagi saya, karna blog saya yang beralamat eenpahlefi-bjm.blogspot.co.id telah di hack orang yang tak bertanggung jawab.. semua akun saya telah hilang, mulai dari email,google drive dll.. Tetapi itu tidak membuat saya menjadi trauma untuk menulis di blog ini :) .

Hari ini saya ingin menulis dokumentasi saya belajar tentang mikrotik, terutama dalam hal loadbalancing.. okelah langsung saja..


Kita buat dulu address-list nya
ip firewall address-list
add address=0.0.0.0/8 list=private-lokal
add address=10.0.0.0/8 list=private-lokal
add address=100.64.0.0/10 list=private-lokal
add address=127.0.0.0/8 list=private-lokal
add address=169.254.0.0/16 list=private-lokal
add address=172.16.0.0/12 list=private-lokal
add address=192.0.0.0/24 list=private-lokal
add address=192.0.2.0/24 list=private-lokal
add address=192.168.0.0/16 list=private-lokal
add address=198.18.0.0/15 list=private-lokal
add address=198.51.100.0/24 list=private-lokal
add address=203.0.113.0/24 list=private-lokal
add address=224.0.0.0/3 list=private-lokal

Selanjutnya kita buat mangle nya
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Loadbalance PCC" dst-address-list=!private-lokal \
    dst-address-type=!local new-connection-mark=WAN1_conn passthrough=yes per-connection-classifier=\
    both-addresses:2/0 src-address-list=private-lokal
add action=mark-connection chain=prerouting dst-address-list=!private-lokal dst-address-type=!local \
    new-connection-mark=WAN2_conn passthrough=yes per-connection-classifier=both-addresses:2/1 \
    src-address-list=private-lokal
add action=mark-routing chain=prerouting connection-mark=WAN1_conn new-routing-mark=to_WAN1 \
    passthrough=yes src-address-list=private-lokal
add action=mark-routing chain=prerouting connection-mark=WAN2_conn new-routing-mark=to_WAN2 \
    passthrough=yes src-address-list=private-lokal

Terakhir kita buat route nya.
/ip route
add distance=1 gateway=192.168.100.1 routing-mark=to_WAN1
add distance=1 gateway=192.168.200.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.3.1
add check-gateway=ping distance=2 gateway=192.168.100.1
add check-gateway=ping distance=3 gateway=192.168.200.1
add check-gateway=ping distance=4 gateway=192.168.3.1

Sudah selesai, jadi kalo misalkan nambah WAN (ISP) yah tinggal lanjutin aja tu mangle nya..

Semoga bermanfaat
Een Pahlefi,S.Kom

Subscribe to receive free email updates: