Load Balance PCC

Load Balance PCC

1. konffig ip address 2 isp dan lokalan
/ip address
add address=192.168.90.2/30 comment=ISP-1 interface=ether1 network=192.168.90.0
add address=192.168.91.2/30 comment=ISP-2 interface=ether2 network=192.168.91.0
add address=192.168.1.1/24 comment="Local Network" interface=ether3 network=192.168.1.0
 
2. konfig dns resolver
 
3. konfig mangle untuk pcc
a. mark koneksi
/ip firewall mangle
add action=mark-connection chain=input connection-state=new in-interface=ether1 new-connection-mark=ISP-1 passthrough=yes
add action=mark-connection chain=input connection-state=new in-interface=ether2 new-connection-mark=ISP-2 passthrough=yes
 
b. tracking koneksi routing
add action=mark-routing chain=output connection-mark=ISP-1 new-routing-mark=Jalur-1 passthrough=no
add action=mark-routing chain=output connection-mark=ISP-2 new-routing-mark=Jalur-2 passthrough=no 
 
c. klasifikasi koneksi lokalan
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=ether3 new-connection-mark=ISP-1 passthrough=yes \
    per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=ether3 new-connection-mark=ISP-2 passthrough=yes \
    per-connection-classifier=both-addresses-and-ports:2/1

d. Atur jalur klasifikasi lokalan
add action=mark-routing chain=prerouting connection-mark=ISP-1 in-interface=ether3 new-routing-mark=Jalur-1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP-2 in-interface=ether3 new-routing-mark=Jalur-2 passthrough=yes
 
 
4. nat 2 isp
 
5. routing 2 isp
a. entry routing 
/ip route
add check-gateway=ping distance=1 gateway=192.168.90.1 routing-mark=Jalur-1
add check-gateway=ping distance=2 gateway=192.168.91.1 routing-mark=Jalur-2

b. Failover
add distance=1 gateway=192.168.90.1
add distance=2 gateway=192.168.91.1