Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /ip route remove [find dynamic=no]
- /ip route
- add check-gateway=ping comment=satu distance=1 gateway=192.168.120.1
- add check-gateway=ping comment=dua distance=2 gateway=192.168.130.1
- add check-gateway=ping comment=tiga distance=3 gateway=192.168.140.1
- add check-gateway=ping comment=empat distance=4 gateway=192.168.150.1
- /ip route
- add check-gateway=ping comment=exit-1 distance=1 gateway=192.168.120.1 routing-mark=exit-1
- add check-gateway=ping comment=exit-2 distance=1 gateway=192.168.130.1 routing-mark=exit-2
- add check-gateway=ping comment=exit-3 distance=1 gateway=192.168.140.1 routing-mark=exit-3
- add check-gateway=ping comment=exit-4 distance=1 gateway=192.168.150.1 routing-mark=exit-4
- /ip route
- add check-gateway=ping comment=jalur-1 distance=1 gateway=192.168.120.1 routing-mark=jalur-1
- add check-gateway=ping comment=jalur-2 distance=1 gateway=192.168.130.1 routing-mark=jalur-2
- add check-gateway=ping comment=jalur-3 distance=1 gateway=192.168.140.1 routing-mark=jalur-3
- add check-gateway=ping comment=jalur-4 distance=1 gateway=192.168.150.1 routing-mark=jalur-4
- /ip route
- add check-gateway=ping comment=jalur-1 distance=1 gateway=192.168.120.1 routing-mark=jalur-1
- add check-gateway=ping comment=jalur-2 distance=2 gateway=192.168.130.1 routing-mark=jalur-1
- add check-gateway=ping comment=jalur-3 distance=3 gateway=192.168.140.1 routing-mark=jalur-1
- add check-gateway=ping comment=jalur-4 distance=4 gateway=192.168.150.1 routing-mark=jalur-1
- /ip route
- add check-gateway=ping comment=jalur-2 distance=1 gateway=192.168.130.1 routing-mark=jalur-2
- add check-gateway=ping comment=jalur-3 distance=2 gateway=192.168.140.1 routing-mark=jalur-2
- add check-gateway=ping comment=jalur-4 distance=3 gateway=192.168.150.1 routing-mark=jalur-2
- add check-gateway=ping comment=jalur-1 distance=4 gateway=192.168.120.1 routing-mark=jalur-2
- /ip route
- add check-gateway=ping comment=jalur-3 distance=1 gateway=192.168.140.1 routing-mark=jalur-3
- add check-gateway=ping comment=jalur-4 distance=2 gateway=192.168.150.1 routing-mark=jalur-3
- add check-gateway=ping comment=jalur-1 distance=3 gateway=192.168.120.1 routing-mark=jalur-3
- add check-gateway=ping comment=jalur-2 distance=4 gateway=192.168.130.1 routing-mark=jalur-3
- /ip route
- add check-gateway=ping comment=jalur-4 distance=1 gateway=192.168.150.1 routing-mark=jalur-4
- add check-gateway=ping comment=jalur-1 distance=2 gateway=192.168.120.1 routing-mark=jalur-4
- add check-gateway=ping comment=jalur-2 distance=3 gateway=192.168.130.1 routing-mark=jalur-4
- add check-gateway=ping comment=jalur-3 distance=4 gateway=192.168.140.1 routing-mark=jalur-4
- /ip firewall mangle remove [find]
- /ip firewall mangle
- add action=accept chain=input dst-address-list=private-lokal src-address-list=private-lokal
- add action=accept chain=prerouting dst-address-list=private-lokal src-address-list=private-lokal
- add action=accept chain=forward dst-address-list=private-lokal src-address-list=private-lokal
- add action=accept chain=postrouting dst-address-list=private-lokal src-address-list=private-lokal
- add action=accept chain=output dst-address-list=private-lokal src-address-list=private-lokal
- /ip firewall mangle
- add action=mark-connection chain=input comment=exit-1 in-interface=ether1 new-connection-mark=exit-1 passthrough=yes
- add action=mark-routing chain=prerouting comment=exit-1 connection-mark=exit-1 new-routing-mark=exit-1 passthrough=no
- add action=mark-routing chain=output comment=exit-1 connection-mark=exit-1 new-routing-mark=exit-1 passthrough=no
- add action=mark-connection chain=input comment=exit-2 in-interface=ether2 new-connection-mark=exit-2 passthrough=yes
- add action=mark-routing chain=prerouting comment=exit-2 connection-mark=exit-2 new-routing-mark=exit-2 passthrough=no
- add action=mark-routing chain=output comment=exit-2 connection-mark=exit-2 new-routing-mark=exit-2 passthrough=no
- add action=mark-connection chain=input comment=exit-3 in-interface=ether3 new-connection-mark=exit-3 passthrough=yes
- add action=mark-routing chain=prerouting comment=exit-3 connection-mark=exit-3 new-routing-mark=exit-3 passthrough=no
- add action=mark-routing chain=output comment=exit-3 connection-mark=exit-3 new-routing-mark=exit-3 passthrough=no
- add action=mark-connection chain=input comment=exit-4 in-interface=ether4 new-connection-mark=exit-4 passthrough=yes
- add action=mark-routing chain=prerouting comment=exit-4 connection-mark=exit-4 new-routing-mark=exit-4 passthrough=no
- add action=mark-routing chain=output comment=exit-4 connection-mark=exit-4 new-routing-mark=exit-4 passthrough=no
- /ip firewall mangle
- add action=mark-connection chain=prerouting comment=trafik connection-mark=no-mark dst-address-list=!private-lokal new-connection-mark=trafik passthrough=yes src-address-list=private-lokal
- /ip firewall mangle
- add action=mark-routing chain=prerouting comment=jalur-1 connection-mark=trafik dst-address-list=!private-lokal dst-address-type=!local new-routing-mark=jalur-1 passthrough=no per-connection-classifier=both-addresses-and-ports:4/0 src-address-list=private-lokal
- add action=mark-routing chain=prerouting comment=jalur-2 connection-mark=trafik dst-address-list=!private-lokal dst-address-type=!local new-routing-mark=jalur-2 passthrough=no per-connection-classifier=both-addresses-and-ports:4/1 src-address-list=private-lokal
- add action=mark-routing chain=prerouting comment=jalur-3 connection-mark=trafik dst-address-list=!private-lokal dst-address-type=!local new-routing-mark=jalur-3 passthrough=no per-connection-classifier=both-addresses-and-ports:4/2 src-address-list=private-lokal
- add action=mark-routing chain=prerouting comment=jalur-4 connection-mark=trafik dst-address-list=!private-lokal dst-address-type=!local new-routing-mark=jalur-4 passthrough=no per-connection-classifier=both-addresses-and-ports:4/3 src-address-list=private-lokal
- /system scheduler
- add interval=15s name=fail-over on-event="log warning (\"=============================\")\r\
- \n#jalur-1 cek\r\
- \n:if ([/ping address=8.8.8.8 interface=ether1 routing=exit-1 count=5] = 0) do={\r\
- \n/ip route disable [find comment=jalur-1 gateway=192.168.120.1 disabled=no]\r\
- \n/ip route set distance=6 [find comment=satu distance=1]\r\
- \nlog error (\"jalur-1 ether1 down\")\r\
- \n} else={\r\
- \n/ip route enable [find comment=jalur-1 gateway=192.168.120.1 disabled=yes]\r\
- \n/ip route set distance=1 [find comment=satu distance=6]\r\
- \nlog warning (\"jalur-1 ether1 up\")\r\
- \n};\r\
- \n\r\
- \n#jalur-2 cek\r\
- \n:if ([/ping address=8.8.8.8 interface=ether2 routing=exit-2 count=5] = 0) do={\r\
- \n/ip route disable [find comment=jalur-2 gateway=192.168.130.1 disabled=no]\r\
- \n/ip route set distance=7 [find comment=dua distance=2]\r\
- \nlog error (\"jalur-2 ether2 down\")\r\
- \n} else={\r\
- \n/ip route enable [find comment=jalur-2 gateway=192.168.130.1 disabled=yes]\r\
- \n/ip route set distance=2 [find comment=dua distance=7]\r\
- \nlog warning (\"jalur-2 ether2 up\")\r\
- \n};\r\
- \n\r\
- \n#jalur-3 cek\r\
- \n:if ([/ping address=8.8.8.8 interface=ether3 routing=exit-3 count=5] = 0) do={\r\
- \n/ip route disable [find comment=jalur-3 gateway=192.168.140.1 disabled=no]\r\
- \n/ip route set distance=8 [find comment=tiga distance=3]\r\
- \nlog error (\"jalur-3 ether3 down\")\r\
- \n} else={\r\
- \n/ip route enable [find comment=jalur-3 gateway=192.168.140.1 disabled=yes]\r\
- \n/ip route set distance=3 [find comment=tiga distance=8]\r\
- \nlog warning (\"jalur-3 ether3 up\")\r\
- \n};\r\
- \n\r\
- \n#jalur-4 cek\r\
- \n:if ([/ping address=8.8.8.8 interface=ether4 routing=exit-4 count=5] = 0) do={\r\
- \n/ip route disable [find comment=jalur-4 gateway=192.168.150.1 disabled=no]\r\
- \nlog error (\"jalur-4 ether4 down\")\r\
- \n} else={\r\
- \n/ip route enable [find comment=jalur-4 gateway=192.168.150.1 disabled=yes]\r\
- \nlog warning (\"jalur-4 ether4 up\")\r\
- \n};\r\
- \nlog warning (\"cek koneksi selesai\")\r\
- \nlog warning (\"=============================\")"
Add Comment
Please, Sign In to add comment