Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /ip route
- add check-gateway=ping comment="GW_PCC_ETHER1" distance=1 gateway=1.1.1.1 routing-mark=to_ether1
- add check-gateway=ping comment="GW_PCC_ETHER2" distance=1 gateway=2.2.2.2 routing-mark=to_ether2
- /ip dhcp-client
- add disabled=no interface=ether1 script=":if (\$bound = 1) do={ /ip route set [find comment=\"GW_PCC_ETHER1\"] gateway=\$\"gateway-address\"}"
- add disabled=no interface=ether2 script=":if (\$bound = 1) do={ /ip route set [find comment=\"GW_PCC_ETHER2\"] gateway=\$\"gateway-address\"}"
- /ip firewall address-list
- add address=0.0.0.0/8 list=ipLokal
- add address=10.0.0.0/8 list=ipLokal
- add address=127.0.0.0/8 list=ipLokal
- add address=169.254.0.0/16 list=ipLokal
- add address=172.16.0.0/12 list=ipLokal
- add address=192.168.99.0/24 list=ipLokal
- add address=192.168.11.0/24 list=ipLokal
- add address=192.168.12.0/24 list=ipLokal
- /ip firewall mangle
- # 1. OPTIMALISASI ICMP
- add action=change-dscp chain=postrouting comment="ICMP CHANGE DSCP" new-dscp=1 protocol=icmp passthrough=yes
- add action=mark-connection chain=postrouting dscp=1 new-connection-mark=ICMPKONEKSI passthrough=yes
- add action=mark-packet chain=postrouting connection-mark=ICMPKONEKSI new-packet-mark=ICMPPAKET passthrough=no
- # 2. BYPASS TRAFIK LOKAL (Satu rule efisien menggunakan address-list)
- add action=accept chain=prerouting comment="Bypass Traffic Lokal" dst-address-list=ipLokal src-address-list=ipLokal
- # 3. PCC MARK CONNECTION (6 Jalur ke Ether1, 1 Jalur ke Ether2)
- add action=mark-connection chain=prerouting comment="LB PCC 6:1 - ETHER1" dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/0 src-address-list=ipLokal
- add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/1 src-address-list=ipLokal
- add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/2 src-address-list=ipLokal
- add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/3 src-address-list=ipLokal
- add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/4 src-address-list=ipLokal
- add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/5 src-address-list=ipLokal
- add action=mark-connection chain=prerouting comment="LB PCC 6:1 - ETHER2" dst-address-list=!ipLokal dst-address-type=!local \
- new-connection-mark=con-ether2 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/6 src-address-list=ipLokal
- # 4. MARK ROUTING (passthrough=no untuk menghemat pemrosesan CPU)
- add action=mark-routing chain=prerouting connection-mark=con-ether1 dst-address-list=!ipLokal \
- new-routing-mark=to_ether1 passthrough=no src-address-list=ipLokal
- add action=mark-routing chain=prerouting connection-mark=con-ether2 dst-address-list=!ipLokal \
- new-routing-mark=to_ether2 passthrough=no src-address-list=ipLokal
- /ip firewall nat
- add action=masquerade chain=srcnat out-interface-list=WAN
Advertisement
Add Comment
Please, Sign In to add comment