You are on page 1of 2

# oct/13/2019 03:56:07

# SESUAIKAN SESUAI KEBUTUHAN


#ether1-DISTRIBUSI==>ip 192.168.12.1/24
#ether2-wifi.id==>ip 192.168.10.1/24
#ether3-wms==>ip 192.168.11.1/24
#
/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
/ip firewall mangle
add action=mark-connection chain=prerouting comment=\
"keluar/Masuk Untuk EACH WAN" in-interface=ether2-wifi.id \
new-connection-mark=cm_in_isp1 packet-mark=no-mark passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether3-wms \
new-connection-mark=cm_in_isp2 packet-mark=no-mark passthrough=yes
add action=mark-routing chain=output connection-mark=cm_in_isp1 \
new-routing-mark=via_modem1 passthrough=yes
add action=mark-routing chain=output connection-mark=cm_in_isp2 \
new-routing-mark=via_modem2 passthrough=yes
add action=jump chain=prerouting comment=\
"LB NTH JUMPER [!!! only 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=ether1-DISTRIBUSI \
new-connection-mark=cm_nth_balancer_1 nth=2,1 passthrough=yes
add action=mark-connection chain=nth-balancer in-interface=ether1-DISTRIBUSI \
new-connection-mark=cm_nth_balancer_2 nth=2,2 passthrough=yes
add action=return chain=nth-balancer
add action=mark-routing chain=prerouting comment="LB NTH ROUTE" \
connection-mark=cm_nth_balancer_1 in-interface=ether1-DISTRIBUSI \
new-routing-mark=via_modem1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=cm_nth_balancer_2 \
in-interface=ether1-DISTRIBUSI new-routing-mark=via_modem2 passthrough=no
add action=jump chain=prerouting comment="LB PCC JUMPER [for any traffic]" \
dst-address-list=!rfc1918 in-interface=ether1-DISTRIBUSI jump-target=\
pcc-balancer protocol=!ospf
add action=jump chain=prerouting dst-address-list=!rfc1918 in-interface=\
ether1-DISTRIBUSI jump-target=pcc-balancer protocol=tcp
add action=jump chain=prerouting dst-address-list=!rfc1918 in-interface=\
ether1-DISTRIBUSI jump-target=pcc-balancer protocol=udp
add action=mark-connection chain=pcc-balancer comment=\
"LB PCC BALANCER CLASSIFIER" in-interface=ether1-DISTRIBUSI \
new-connection-mark=cm_pcc_balancer_1 passthrough=yes \
per-connection-classifier=dst-address-and-port:2/0
add action=mark-connection chain=pcc-balancer in-interface=ether1-DISTRIBUSI \
new-connection-mark=cm_pcc_balancer_2 passthrough=yes \
per-connection-classifier=src-address-and-port:2/1
add action=return chain=pcc-balancer in-interface=ether1-DISTRIBUSI
add action=mark-routing chain=prerouting comment="LB PCC ROUTE" \
connection-mark=cm_pcc_balancer_1 in-interface=ether1-DISTRIBUSI \
new-routing-mark=via_modem1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=cm_pcc_balancer_2 \
in-interface=ether1-DISTRIBUSI new-routing-mark=via_modem2 passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether2-wifi.id
add action=masquerade chain=srcnat out-interface=ether3-wms
add action=masquerade chain=srcnat src-address=192.168.12.0/24

You might also like