14 Januari 2013

Load Balance Dengan Metode PCC


Kebutuhan pertama adalah RB750. Dengan 2 sumber koneksi internet, dan 1 keluaran untuk LAN. Ini bersifat dokumentasi khusus untuk pribadi tapi bisa juga diimplementasikan untuk umum. Mohon dibaca dengan baik dan seksama.

Pertama, kita bikin mangle nya dulu.
/ip firewall mangle
add action=mark-connection chain=input comment="NEW Load Balance" connection-state=new disabled=no in-interface=ether1 new-connection-mark=maxi_conn passthrough=yes
add action=mark-connection chain=input connection-state=new disabled=no in-interface=ether2 new-connection-mark=fm_conn1 passthrough=yes
add action=mark-routing chain=output connection-mark=maxi_conn disabled=no new-routing-mark=jalur-1 passthrough=no
add action=mark-routing chain=output connection-mark=fm_conn1 disabled=no new-routing-mark=jalur-2 passthrough=no
add action=mark-connection chain=prerouting disabled=no dst-address-type=!local in-interface=ether5 new-connection-mark=maxi_conn passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting disabled=no dst-address-type=!local in-interface=ether5 new-connection-mark=fm_conn1 passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting connection-mark=maxi_conn disabled=no in-interface=ether5 new-routing-mark=jalur-1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=fm_conn1 disabled=no in-interface=ether5 new-routing-mark=jalur-2 passthrough=yes

Lalu NAT koneksinya.
/ip firewall nat
add chain=srcnat action=masquerade src-address="IP Lokal"

Tinggal step terakhir adalah routing.
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ether1 routing-mark=Jalur-1
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ether2 routing-mark=Jalur-2
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway="ether1, ether2"
add disabled=no distance=2 dst-address=0.0.0.0/0 gateway=ether2
add disabled=no distance=3 dst-address=0.0.0.0/0 gateway=ether1