Loadbalance PCC + External Proxy Dan Automatic bypass Proxy

Bagi Rekan rekan yang mempunyai usaha Warnet dengan berlanggan sp**dy dan mempunyai Line telpon lebih dari 1 .... mungkin dapat kita manfaatkan untuk kita LoadBalance supaya bandwith yang kita dapat menjadi lebih optimal untuk peningkatan akses Internet.

Berikut ini saya sampaikan langkah langkah bagaimana kita membuat Loadbalancing dengan perangkat Routerboad Mikrotik :

Asumsi IP :
Untuk Device :
Langkah 1:
Kita perlu pembuatan sebuah mangle yang berfungsi untuk menandai berbagai paket yang masuk dari public

Code:
[admin@MikroTik] /ip firewall mangle>
chain=postrouting action=mark-packet new-packet-mark=HIT passthrough=no protocol=tcp dst-port=80,81,8080,3128 dscp=12 comments="Proxy Los"

chain=prerouting action=mark-connection new-connection-mark=PROXY-1 passthrough=yes connection-state=new in-interface=Squid comments="LOAD BALANCE PROXY PCC"
chain=prerouting action=mark-connection new-connection-mark=PROXY-2 passthrough=yes connection-state=new in-interface=Squid 
chain=prerouting action=mark-connection new-connection-mark=PROXY-3 passthrough=yes connection-state=new in-interface=Squid 
chain=prerouting action=mark-connection new-connection-mark=PROXY-1 passthrough=yes in-interface=Squid connection-mark=PROXY-1 
chain=prerouting action=mark-connection new-connection-mark=PROXY-2 passthrough=yes in-interface=Squid connection-mark=PROXY-2 
chain=prerouting action=mark-connection new-connection-mark=PROXY-3 passthrough=yes in-interface=Squid connection-mark=PROXY-3 
chain=prerouting action=mark-connection new-connection-mark=PROXY-1 passthrough=yes protocol=tcp dst-address-type=!local in-interface=Squid dst-port=80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:3/0 
chain=prerouting action=mark-connection new-connection-mark=PROXY-2 passthrough=yes protocol=tcp dst-address-type=!local in-interface=Squid dst-port=80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:3/1 
chain=prerouting action=mark-connection new-connection-mark=PROXY-3 passthrough=yes protocol=tcp dst-address-type=!local in-interface=Squid dst-port=80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:3/2 
chain=prerouting action=mark-routing new-routing-mark=Route-Proxy-1 passthrough=yes in-interface=Squid connection-mark=PROXY-1 
chain=prerouting action=mark-routing new-routing-mark=Route-Proxy-1 passthrough=yes in-interface=Squid connection-mark=PROXY-2 
chain=prerouting action=mark-routing new-routing-mark=Route-Proxy-2 passthrough=yes in-interface=Squid connection-mark=PROXY-3 

chain=input action=mark-connection new-connection-mark=ADSL-1 passthrough=yes connection-state=new in-interface=Lokal comments="LOAD BALANCE LOKAL"
chain=input action=mark-connection new-connection-mark=ADSL-2 passthrough=yes connection-state=new in-interface=Lokal 
chain=input action=mark-connection new-connection-mark=ADSL-3 passthrough=yes connection-state=new in-interface=Lokal 
chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=no in-interface=Lokal connection-mark=ADSL-1 
chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=no in-interface=Lokal connection-mark=ADSL-2 
chain=prerouting action=mark-connection new-connection-mark=ADSL-3 passthrough=no in-interface=Lokal connection-mark=ADSL-3 

chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=yes protocol=tcp dst-address-type=!local in-interface=Lokal dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:3/0 comments="AUTOMATIC DISABLE IF PROXY DOWN"
chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=yes protocol=tcp dst-address-type=!local in-interface=Lokal dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:3/1 
chain=prerouting action=mark-connection new-connection-mark=ADSL-3 passthrough=yes protocol=tcp dst-address-type=!local in-interface=Lokal dst-port=!80,81,8080,3128 per-connection-classifier=both-addresses-and-ports:3/2 

chain=prerouting action=mark-connection new-connection-mark=ADSL-1 passthrough=yes dst-address-type=!local in-interface=Lokal per-connection-classifier=both-addresses-and-ports:3/0 comments="AUTOMATIC ENABLE IF PROXY DOWN"
chain=prerouting action=mark-connection new-connection-mark=ADSL-2 passthrough=yes dst-address-type=!local in-interface=Lokal per-connection-classifier=both-addresses-and-ports:3/1 
chain=prerouting action=mark-connection new-connection-mark=ADSL-3 passthrough=yes dst-address-type=!local in-interface=Lokal per-connection-classifier=both-addresses-and-ports:3/2 

chain=prerouting action=mark-routing new-routing-mark=jalur-1 passthrough=yes in-interface=Lokal connection-mark=ADSL-1 
chain=prerouting action=mark-routing new-routing-mark=jalur-1 passthrough=yes in-interface=Lokal connection-mark=ADSL-2 
chain=prerouting action=mark-routing new-routing-mark=jalur-2 passthrough=yes in-interface=Lokal connection-mark=ADSL-3 

chain=prerouting action=mark-connection new-connection-mark=Trafik PB + POKER passthrough=yes protocol=tcp dst-address-list=Poker + PB dst-port=49100 comments="POKER + POINT BLANK"
chain=prerouting action=mark-connection new-connection-mark=Trafik PB + POKER passthrough=yes protocol=udp dst-address-list=Poker + PB dst-port=40000-40010 
chain=prerouting action=mark-connection new-connection-mark=Trafik PB + POKER passthrough=yes protocol=tcp dst-address-list=Poker + PB dst-port=39190 
chain=prerouting action=mark-packet new-packet-mark=PB + Poker passthrough=yes connection-mark=Trafik PB + POKER 

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=Lokal connection-mark=Trafik PB + POKER comments="ROUTING POKER + POINT BLANK"
chain=prerouting action=mark-routing new-routing-mark=Poker + PB passthrough=no src-address=192.168.3.2-192.168.3.16 dst-address-list=Poker + PB in-interface=Lokal connection-mark=Trafik PB + POKER

Nanti kita akan terlihat hasilnya seperti ini :

Kemudian langkah berikutnya kita buat NAT (Network Address Translation)

pcc

chain=srcnat action=masquerade out-interface=Telkom comments="NAT LOKAL"
chain=srcnat action=masquerade out-interface=Telkom-1

chain=dstnat action=dst-nat to-addresses=192.168.4.2 to-ports=3128 protocol=tcp src-address-list=IP Users dst-address-list=!IP Proxy dst-port=80,81,8080,3128 comments=TRANSPARANT SQUID"

chain=dstnat action=dst-nat to-ports=53 protocol=tcp in-interface=Lokal dst-port=53 comments="TRANSPARENT DNS"
chain=dstnat action=dst-nat to-ports=53 protocol=udp in-interface=Lokal dst-port=53
chain=dstnat action=dst-nat to-ports=53 protocol=tcp in-interface=Squid dst-port=53
chain=dstnat action=dst-nat to-ports=53 protocol=udp in-interface=Squid dst-port=53

rule ini khusus bagi yg memakai DNS server di squid proxy nya.

chain=dstnat action=dst-nat to-addresses=192.168.4.2 to-ports=53 protocol=tcp in-interface=Squid dst-port=53 comments="TRANSPARENT BIND9"
chain=dstnat action=dst-nat to-addresses=192.168.4.2 to-ports=53 protocol=udp in-interface=Squid dst-port=53

Hasilnya akan seperti ini :

Setelah pembuatan NAT, kita lanjutkan pembuatan Routingnya atau
ROUTE bahasa gampangnya arah tujuan

berikut tambahan buat poker dan point blank yang bertujuan unutuk memberi aliran beandwit yang lebih atu juga untuk supaya tidak terjadi login berulang-ulang

pcc

chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker + PB address-list-timeout=0s dst-port=843 comments="SCANNER POKER + POINT BLANK"
chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker + PB address-list-timeout=0s dst-port=9339
chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker + PB address-list-timeout=0s dst-port=39190
chain=forward action=add-dst-to-address-list protocol=tcp address-list=Poker + PB address-list-timeout=0s dst-port=49100
chain=forward action=add-dst-to-address-list protocol=udp address-list=Poker + PB address-list-timeout=0s dst-port=40000-40010

Berikut hasil screencrotnya :
script ini untuk keadaan di mana proxy external mati yang disebabkan karena banyak hal

pcc

;;; MANGLE PROXY
192.168.4.2

add comment="MANGLE PROXY" disabled=no down-script=
\nip fi na en num=3\r\
\nip fi ma en num=22\r\
\nip fi ma en num=23\r\
\nip fi ma en num=24\r\
\nip fi ma dis num=19\r\
\nip fi ma dis num=20\r\
\nip fi ma dis num=21\r\
\nip proxy set enable=yes\r\
\n" host=192.168.4.2 interval=1s timeout=1s up-script="ip fi na en num=2\r\
\nip fi na dis num=3\r\
\nip fi ma dis num=22\r\
\nip fi ma dis num=23\r\
\nip fi ma dis num=24\r\
\nip fi ma en num=19\r\
\nip fi ma en num=20\r\
\nip fi ma en num=21\r\
\nip proxy set enable=no\r\
\n"
Rule ini untuk Yang memakai PCBOX untuk routernya agar bisa automatis ke Proxy internal jika proxy down bisa nambahin script ini di NAT

pcc

;;; AUTOMATIC ENABLE IF PROXY DOWN ---> Redirect to internal proxy | monitoring by netwatch
chain=dstnat action=redirect to-ports=3128 protocol=tcp
routing-mark=!jalur-1 src-address-list=IP Users dst-port=80,81,8080,3128
connection-mark=!ADSL-1

Demikian sekilas pembuatan Loadbalance type PCC dengan menggunakan 2 line sp**dy pada mikrotik.
Semoga bermanfaat dan selamat mencoba ...

thanks to donipermono1982
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description
  • description

Video Gallery

  • Linux
    sekedar informasi, sekarang zimbra sudah diakuisisi oleh VMWare. jadi nantinya logo webmail zimbra kita akan ada logo VMware-nya.
  • Foto
    kalo mau buat efek foto kembar yang penting pilih minimal 3 foto (mau lebih juga terserah anda aj..)yang setingan tempat dan letak kameranya
  • Network
    setelah anda membongkar dus, dan menyiapkan koneksi. yang perlu anda lakukan adalah:
  • Serba-Serbi
    16 Cara Mengikat Sepatu Ala Jepang share buat teman2 & cew ato cow yang senang menggunakan sepatu bertali. Selamat mencoba
  • Tips-Trik
    Jika agan pengguna komputer, pasti sudah tidak asing lagi dengan yang namanya mouse. Mouse adalah salah satu pendamping setia dari komputer. Hampir semua jenis mouse memiliki 3 buah tombol. Tombol kiri, tombol kanan dan tombol scroll yang ada di tengah
  • Windows
    Windows 7 merupakan versi yang jauh lebih baik daripada versi terbaru windows, yaitu windows Vista. Dan windows 7 dilengkapi dengan banyak fitur baru.