-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathload-balance_failover.txt
78 lines (68 loc) · 4.23 KB
/
load-balance_failover.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# Script Load Balance Fail Over 2 ISP (Sama Bandwidth)
#
# Last Update: 25/04/2021 00:28:35 GMT+7
#
# Project website: https://kakiteng.com
#
# ======================================================================================================
# Diketahui :
#
# Port ISP 1 = ether1>ISP1
# Gateway = 192.168.100.1
#
# Port ISP 2 = ether2>ISP2
# Gateway = 192.168.200.1
#
# Lokal/Client = ether3>LOKAL
#
# Noted : Silahkan sesuaikan Interface dan Gateway
#
/ip firewall mangle
add action=mark-connection chain=prerouting comment="Pulang Pergi Lewat WAN yang Sama" connection-mark=no-mark in-interface=ether1>ISP1 new-connection-mark=conn_in_isp1 passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether2>ISP2 new-connection-mark=conn_in_isp2 passthrough=yes
add action=mark-routing chain=output connection-mark=conn_in_isp1 new-routing-mark=ISP1 passthrough=yes
add action=mark-routing chain=output connection-mark=conn_in_isp2 new-routing-mark=ISP2 passthrough=yes
add action=jump chain=prerouting comment="+++++++++++ PCC Jumper For TCP 80,8080 & UDP 443 +++++++++++" dst-address-list=!network_IPv4 dst-port=80,8080 in-interface=ether3>LOKAL jump-target=pcc-balancer_80 protocol=tcp
add action=jump chain=prerouting dst-address-list=!network_IPv4 dst-port=443 in-interface=ether3>LOKAL jump-target=pcc-balancer_80 protocol=udp
add action=mark-connection chain=pcc-balancer_80 in-interface=ether3>LOKAL new-connection-mark=conn_pcc_80-1 passthrough=yes per-connection-classifier=src-address-and-port:2/0
add action=mark-connection chain=pcc-balancer_80 in-interface=ether3>LOKAL new-connection-mark=conn_pcc_80-2 passthrough=yes per-connection-classifier=src-address-and-port:2/1
add action=return chain=pcc-balancer_80 in-interface=ether3>LOKAL
add action=mark-routing chain=prerouting comment="Route Traffic TCP 80,8080 & UDP 443" connection-mark=conn_pcc_80-1 in-interface=ether3>LOKAL new-routing-mark=ISP2 passthrough=no
add action=mark-routing chain=prerouting connection-mark=conn_pcc_80-2 in-interface=ether3>LOKAL new-routing-mark=ISP1 passthrough=no
add action=jump chain=prerouting comment="++++++++++++++++ PCC Jumper For Global Traffic++++++++++++++++" dst-address-list=!network_IPv4 in-interface=ether3>LOKAL jump-target=pcc-balancer_any protocol=!ospf
add action=mark-connection chain=pcc-balancer_any in-interface=ether3>LOKAL new-connection-mark=conn_pcc_any-1 passthrough=yes per-connection-classifier=dst-address-and-port:2/0
add action=mark-connection chain=pcc-balancer_any in-interface=ether3>LOKAL new-connection-mark=conn_pcc_any-2 passthrough=yes per-connection-classifier=dst-address-and-port:2/1
add action=return chain=pcc-balancer_any in-interface=ether3>LOKAL
add action=mark-routing chain=prerouting comment="Route For Global Traffic" connection-mark=conn_pcc_any-1 in-interface=ether3>LOKAL new-routing-mark=ISP1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=conn_pcc_any-2 in-interface=ether3>LOKAL new-routing-mark=ISP2 passthrough=no
/ip route
add comment="Gateway ISP1" distance=1 dst-address=9.9.9.9 gateway=192.168.100.1
add comment="Gateway ISP2" distance=1 dst-address=9.9.9.10 gateway=192.168.200.1
add check-gateway=ping comment="Koneksi Utama ke ISP1" distance=1 gateway=9.9.9.9 target-scope=30
add check-gateway=ping comment="Koneksi Fail Over ke ISP2" distance=2 gateway=9.9.9.10 target-scope=30
add check-gateway=ping distance=1 gateway=9.9.9.9 routing-mark=ISP1 target-scope=30
add check-gateway=ping distance=1 gateway=9.9.9.10 routing-mark=ISP2 target-scope=30
/system note
set note=" _ _ _ _ _\
\n _[+][+][+]_ [+] [+]\
\n [+] [+] [+] [+]\
\n [+] [+] [+]\
\n [+] [+][+]\
\n [+] _ [+] [+]\
\n [+]_ _ _[+] [+] [+]\
\n [+][+][+] [+] [+]\
\n ________________________\
\n ++++ Mas iChand KW ++++\
\n ++++ 0821 2076 6622 ++++\
\n ++ fb.com/ichandkusuma +\
\n \r\
\n \
\n "
############################
/ip firewall address-list
add address=127.0.0.0/8 list=network_IPv4
add address=224.0.0.0/4 list=network_IPv4
add address=10.0.0.0/8 list=network_IPv4
add address=172.16.0.0/12 list=network_IPv4
add address=192.168.0.0/16 list=network_IPv4