Bitsrapid

Tuesday, June 7, 2016



        SCRIP LOAD BALANCE NTH+PCC

 /ip firewall address-list
add address=192.168.0.0/16 list=rfc1918
add address=172.16.0.0/12 list=rfc1918
add address=10.0.0.0/8 list=rfc1918


ni manggle nya
/ip firewall mangle
add action=mark-connection chain=prerouting comment="in/out for each wan\
" connection-mark=no-mark in-interface=pppoe-out1 \
new-connection-mark=cm_in_isp1
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=pppoe-out2 new-connection-mark=cm_in_isp2
add action=mark-routing chain=output connection-mark=cm_in_isp1 \
new-routing-mark=via_pppoe1
add action=mark-routing chain=output connection-mark=cm_in_isp2 \
new-routing-mark=via_pppoe2
add action=jump chain=prerouting comment="lb nth jumper for tcp 80 traffic" \
connection-state=new dst-address-list=!rfc1918 dst-port=80 in-interface=\
all-ethernet jump-target=nth-balancer protocol=tcp
add action=mark-connection chain=nth-balancer comment=\
"lb nth balancer classifier" in-interface=ether2 new-connection-mark=\
cm_nth_balancer_1 nth=2,1
add action=mark-connection chain=nth-balancer in-interface=ether2 \
new-connection-mark=cm_nth_balancer_2 nth=2,2
add action=return chain=nth-balancer in-interface=ether2
add action=mark-routing chain=prerouting comment="lb nth route" \
connection-mark=cm_nth_balancer_1 in-interface=ether2 new-routing-mark=\
via_pppoe1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=cm_nth_balancer_2 \
in-interface=ether2 new-routing-mark=via_pppoe2 passthrough=no
add action=jump chain=prerouting comment="lb pcc jumper for any trafik" \
dst-address-list=!rfc1918 in-interface=ether2 jump-target=pcc-balancer \
protocol=!ospf
add action=jump chain=prerouting dst-address-list=!rfc1918 in-interface=ether2 \
jump-target=pcc-balancer protocol=tcp
add action=jump chain=prerouting dst-address-list=!rfc1918 in-interface=ether2 \
jump-target=pcc-balancer protocol=udp
add action=mark-connection chain=pcc-balancer comment=\
"lb pcc balancer classifier" in-interface=ether2 new-connection-mark=\
cm_pcc_balancer_1 per-connection-classifier=dst-address-and-port:2/0
add action=mark-connection chain=pcc-balancer in-interface=ether2 \
new-connection-mark=cm_pcc_balancer_2 per-connection-classifier=\
dst-address-and-port:2/1
add action=return chain=pcc-balancer in-interface=ether2
add action=mark-routing chain=prerouting comment="lb pcc route" \
connection-mark=cm_pcc_balancer_1 in-interface=ether2 new-routing-mark=\
via_pppoe1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=cm_pcc_balancer_2 \
in-interface=ether2 new-routing-mark=via_pppoe2 passthrough=no


lanjut di route
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out1 routing-mark=via_pppoe1
add check-gateway=ping distance=1 gateway=pppoe-out2 routing-mark=via_pppoe2
add distance=1 gateway=pppoe-out1
add distance=2 gateway=pppoe-out2