Searching...
Jumat, 21 Februari 2014

Load Balancing PCC dan External Proxy dan Automatic Bypass Proxy Jika Down

05.54



Assalamu'alaikum wr. wb.
Alhamdulillah saya ingat posting pada blog ini yang cukup lama tidak ada postingan baru, kali ini saya posting mengenai cara membuat 2 (dua) jalur internet yang digabungkan menjadi 1 jalur dalam jaringan lokal yang biasanya disebut dengan istilah loadbalancing. sebenarnya banyak teknik loadbalancing yang bisa diterapkan dalam mikrotik, disini saya menggunakan loadbalancing dengan teknik PCC (Per Connection Classifier).
credit :  donipermono1982 pada forum http://www.forummikrotik.com

>ip fi mangle 
add chain=postrouting action=mark-packet new-packet-mark=HIT passthrough=no protocol=tcp dst-port=80,81,8080,3128 dscp=12 comment="Proxy Los"
add chain=prerouting action=mark-connection new-connection-mark=PROXY-1 passthrough=yes connection-state=new in-interface=proxy comment="LOAD BALANCE PROXY PCC"
add chain=prerouting action=mark-connection new-connection-mark=PROXY-2 passthrough=yes connection-state=new in-interface=proxy
add chain=prerouting action=mark-connection new-connection-mark=PROXY-1 passthrough=yes in-interface=proxy connection-mark=PROXY-1
add chain=prerouting action=mark-connection new-connection-mark=PROXY-2 passthrough=yes in-interface=proxy connection-mark=PROXY-2
add chain=prerouting action=mark-connection new-connection-mark=PROXY-1 passthrough=yes protocol=tcp dst-address-type=!local in-interface=proxy dst-port=80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:2/0
add chain=prerouting action=mark-connection new-connection-mark=PROXY-2 passthrough=yes protocol=tcp dst-address-type=!local in-interface=proxy dst-port=80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:2/1
add chain=prerouting action=mark-routing new-routing-mark=Route-Proxy-1 passthrough=yes in-interface=proxy connection-mark=PROXY-1
add chain=prerouting action=mark-routing new-routing-mark=Route-Proxy-2 passthrough=yes in-interface=proxy connection-mark=PROXY-2
add chain=input action=mark-connection new-connection-mark=ADSL-1 passthrough=yes connection-state=new in-interface=warnet comment="LOAD BALANCE LOKAL Warnet"
add chain=input action=mark-connection new-connection-mark=ADSL-2 passthrough=yes connection-state=new in-interface=warnet
add chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=no in-interface=warnet connection-mark=ADSL-1
add chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=no in-interface=warnet connection-mark=ADSL-2
add chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=yes protocol=tcp dst-address-type=!local in-interface=warnet dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:2/0 comment="AUTOMATIC DISABLE IF PROXY DOWN"
add chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=yes protocol=tcp dst-address-type=!local in-interface=warnet dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:2/1
add chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=yes dst-address-type=!local in-interface=warnet per-connection-classifier=both-addresses-and-ports:2/0 comment="AUTOMATIC ENABLE IF PROXY DOWN"
add chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=yes dst-address-type=!local in-interface=warnet per-connection-classifier=both-addresses-and-ports:2/1
add chain=prerouting action=mark-routing new-routing-mark=jalur-1 passthrough=yes in-interface=warnet connection-mark=ADSL-1
add chain=prerouting action=mark-routing new-routing-mark=jalur-2 passthrough=yes in-interface=warnet connection-mark=ADSL-2
add chain=prerouting action=mark-connection new-connection-mark=Trafik_PB+POKER passthrough=yes protocol=tcp dst-address-list=Poker+PB dst-port=49100 comment="POKER + POINT BLANK"
add chain=prerouting action=mark-connection new-connection-mark=Trafik_PB+POKER passthrough=yes protocol=udp dst-address-list=Poker+PB dst-port=40000-40010
add chain=prerouting action=mark-connection new-connection-mark=Trafik_PB+POKER passthrough=yes protocol=tcp dst-address-list=Poker+PB dst-port=39190
add chain=prerouting action=mark-packet new-packet-mark=PB+Poker passthrough=yes connection-mark=Trafik_PB+Poker
add chain=prerouting action=mark-routing new-routing-mark=Poker+PB passthrough=no src-address=192.168.0.2-192.168.0.30 dst-address-list=Poker+PB in-interface=warnet connection-mark=Trafik_PB+Poker comment="ROUTING POKER + POINT BLANK"
add chain=input action=mark-connection new-connection-mark=ADSL-1 passthrough=yes connection-state=new in-interface=hotspot comment="LOAD BALANCE LOKAL Hotspot"
add chain=input action=mark-connection new-connection-mark=ADSL-2 passthrough=yes connection-state=new in-interface=hotspot
add chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=no in-interface=hotspot connection-mark=ADSL-1
add chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=no in-interface=hotspot connection-mark=ADSL-2
add chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=yes protocol=tcp dst-address-type=!local in-interface=hotspot dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:2/0 comment="AUTOMATIC DISABLE IF PROXY DOWN"
add chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=yes protocol=tcp dst-address-type=!local in-interface=hotspot dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:2/1
add chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=yes dst-address-type=!local in-interface=hotspot per-connection-classifier=both-addresses-and-ports:2/0 comment="AUTOMATIC ENABLE IF PROXY DOWN"
add chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=yes dst-address-type=!local in-interface=hotspot per-connection-classifier=both-addresses-and-ports:2/1
add chain=prerouting action=mark-routing new-routing-mark=jalur-1 passthrough=yes in-interface=hotspot connection-mark=ADSL-1
add chain=prerouting action=mark-routing new-routing-mark=jalur-2 passthrough=yes in-interface=hotspot connection-mark=ADSL-2
add chain=prerouting action=mark-routing new-routing-mark=Poker+PB passthrough=no src-address=10.10.10.2-10.10.10.250 dst-address-list=Poker+PB in-interface=hotspot connection-mark=Trafik_PB+Poker
>ip fi nat
add chain=dstnat action=dst-nat to-ports=53 protocol=tcp in-interface=warnet dst-port=53 comment="TRANSPARENT DNS"
add chain=dstnat action=dst-nat to-ports=53 protocol=udp in-interface=warnet dst-port=53
add chain=dstnat action=dst-nat to-ports=53 protocol=tcp in-interface=hotspot dst-port=53 comment="TRANSPARENT DNS"
add chain=dstnat action=dst-nat to-ports=53 protocol=udp in-interface=hotspot dst-port=53
add chain=dstnat action=dst-nat to-ports=53 protocol=tcp in-interface=proxy dst-port=53
add chain=dstnat action=dst-nat to-ports=53 protocol=udp in-interface=proxy dst-port=53
>ip fi mangle
add chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker+PB address-list-timeout=0s dst-port=843 comment="SCANNER POKER + POINT BLANK"
add chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker+PB address-list-timeout=0s dst-port=9339
add chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker+PB address-list-timeout=0s dst-port=39190
add chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker+PB address-list-timeout=0s dst-port=49100
add chain=forward action=add-dst-to-address-list protocol=udp address-list=Poker+PB address-list-timeout=0s dst-port=40000-40010

0 komentar:

Posting Komentar