Set jam supaya tidak berubah ubah (NTP client)
/system ntp client \
set enabled=yes mode=unicast \
primary-ntp=152.118.24.8 \
secondary-ntp=202.169.224.16
/tool fetch address=ixp.mikrotik.co.id src-path=/download/nice.rsc mode=http;
import nice.rsc
tambahkan ip address pada lan router
Code:
ip address add address=192.168.1.100/24 interface=WAN
ip address add address=192.168.0.0/24 interface=LAN
ip address add address=192.168.30.0/24 interface=PROXY
ip address proxy=192.168.30.2
ip firewall nat
/ip firewall nat add chain=dstnat action=dst-nat to-addresses=192.168.30.2 to-ports=3128 protocol=tcp dst port=80,8080.3128 src-address==!192.168.30.0/24
PROXY HIT LOSS
Code:
ip firewall mangle add action=mark-packet new-packet-mark=PROXY-HIT dscp=12 passtrough=no
Proxy HIT LOSS (ZPH METHOD)
Code:
queue tree add name=PROXY-HIT parent=LAN packet-mark=PROXY-HIT
kemudian kita lakukan marking connection pada setiap pc-client
Code:
/ip firewall mangle
add action=mark-packet chain=prerouting disabled=yes dscp=12 new-packet-mark=\
"PROXY-HIT " passthrough=no
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc01 src-address=192.168.88.101
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc02 src-address=192.168.88.102
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc03 src-address=192.168.88.103
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc04 src-address=192.168.88.104
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc05 src-address=192.168.88.105
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc06 src-address=192.168.88.106
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc07 src-address=192.168.88.107
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc08 src-address=192.168.88.108
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc09 src-address=192.168.88.109
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc10 src-address=192.168.88.110
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc11 src-address=192.168.88.111
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
pc12 src-address=192.168.88.112
add action=mark-connection chain=prerouting disabled=yes new-connection-mark=\
op src-address=192.168.88.100
setelah itu kita lakukan marking packet dari setiap connection yang terjadi
Code:
/ip firewall mangle
add action=mark-packet chain=prerouting connection-mark=pc01 disabled=yes \
new-packet-mark=pc01 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc02 disabled=yes \
new-packet-mark=pc02 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc03 disabled=yes \
new-packet-mark=pc03 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc04 disabled=yes \
new-packet-mark=pc04 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc05 disabled=yes \
new-packet-mark=pc05 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc06 disabled=yes \
new-packet-mark=pc06 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc07 disabled=yes \
new-packet-mark=pc07 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc08 disabled=yes \
new-packet-mark=pc08 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc09 disabled=yes \
new-packet-mark=pc09 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc10 disabled=yes \
new-packet-mark=pc10 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc11 disabled=yes \
new-packet-mark=pc11 passthrough=no
add action=mark-packet chain=prerouting connection-mark=pc12 disabled=yes \
new-packet-mark=pc12 passthrough=no
add action=mark-packet chain=prerouting connection-mark=op disabled=yes \
new-packet-mark=op passthrough=no
tambahkan queue tree yang digunakan parent pada interface lan agar bandwith bisa terbagi rata
Code:
queue tree add parent=LAN max-limit=40M name=Downlink
tambahan penggunaan PCQ agar setting lebih maximal lagi
Code:
queue type add name=PCQ-1Mbps kind=pcq pcq-rate=1024k pcq-classifier=dst-address
tambahkan child pada parent sesuai dengan packet mark
Code:
/queue tree
add disabled=yes name=PROXY-HIT packet-mark="PROXY-HIT " parent=LAN queue=\
default
add disabled=yes name=Downlink parent=LAN queue=default
add disabled=yes limit-at=128k max-limit=1024k name=pc01 packet-mark=pc01 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc02 packet-mark=pc02 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc03 packet-mark=pc03 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc04 packet-mark=pc04 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc05 packet-mark=pc05 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc06 packet-mark=pc06 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc07 packet-mark=pc07 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc08 packet-mark=pc08 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc09 packet-mark=pc09 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc10 packet-mark=pc10 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc11 packet-mark=pc11 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=pc12 packet-mark=pc12 \
parent=Downlink queue=PCQ-1Mbps
add disabled=yes limit-at=128k max-limit=1024k name=BILLING packet-mark=op \
parent=Downlink queue=PCQ-1Mbps
ada permintaan untuk traffic shapping upload, menurut saya ini sih ngga begitu masalah untuk upload bisa menggunakan simple queue tapi bagi yang mau repot2 dikit gw kasihkan, ini asumsi bandwith upstream 1Mbps juga,
queue tree upload yang digunakan parent pada interface WAN
Code:
Queue Tree add name=Uplink Parent=WAN max-limit=1024k
queue upload type
Code:
queue type add name=PCQ-1Mbps kind=pcq pcq-rate=1024k pcq-classifier=src-address
tambahkan child pada parent sesuai dengan packet mark
Code:
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc01-up packet-mark=pc01 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc02-up packet-mark=pc02 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc03-up packet-mark=pc03 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc04-up packet-mark=pc04 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc05-up packet-mark=pc05 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc06-up packet-mark=pc06 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc07-up packet-mark=pc07 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc08-up packet-mark=pc08 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc09-up packet-mark=pc09 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc10-up packet-mark=pc10 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc11-up packet-mark=pc11 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc12-up packet-mark=pc12 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=op-up packet-mark=op queue=PCQ-1Mbps
maka setelah itu bandwith akan tershapping rata kepada setiap user
selanjut nya apabila proxy down user masih bisa terkoneksi ,ditambah kan pengaturan di bawah ini
Auto Enable & Disable Transparent Proxy NAT
1. Masuk ke mikrotik via winbox
2. Klik Tools------>Netwatch
untuk down
1. Klik tanda plus
2. Isi Host dengan IP address PC proxy server kamu, contoh 192.168.30.2
3. Interval 00:00:01
4. Time Out isikan saja 1000 ms
5. Pada tab "Down" isikan : ip firewall nat disable 1
6. ok (simpan)
selanjut nya untuk up
1. Klik tanda plus
2. Isi Host dengan IP address PC proxy server kamu, contoh 192.168.30.2
3. Interval 00:00:01
4. Time Out isikan saja 1000 ms
5. Pada tab "UP" isikan :ip firewall nat enable 1
6. ok (simpan)
queue tree upload yang digunakan parent pada interface WAN
Code:
Queue Tree add name=Uplink Parent=WAN max-limit=1024k
queue upload type
Code:
queue type add name=PCQ-1Mbps kind=pcq pcq-rate=1024k pcq-classifier=src-address
tambahkan child pada parent sesuai dengan packet mark
Code:
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc01-up packet-mark=pc01 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc02-up packet-mark=pc02 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc03-up packet-mark=pc03 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc04-up packet-mark=pc04 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc05-up packet-mark=pc05 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc06-up packet-mark=pc06 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc07-up packet-mark=pc07 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc08-up packet-mark=pc08 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc09-up packet-mark=pc09 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc10-up packet-mark=pc10 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc11-up packet-mark=pc11 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=pc12-up packet-mark=pc12 queue=PCQ-1Mbps
queue tree add parent=Uplink limit-at=128k max-limit=1024k name=op-up packet-mark=op queue=PCQ-1Mbps
maka setelah itu bandwith akan tershapping rata kepada setiap user
selanjut nya apabila proxy down user masih bisa terkoneksi ,ditambah kan pengaturan di bawah ini
Auto Enable & Disable Transparent Proxy NAT
1. Masuk ke mikrotik via winbox
2. Klik Tools------>Netwatch
untuk down
1. Klik tanda plus
2. Isi Host dengan IP address PC proxy server kamu, contoh 192.168.30.2
3. Interval 00:00:01
4. Time Out isikan saja 1000 ms
5. Pada tab "Down" isikan : ip firewall nat disable 1
6. ok (simpan)
selanjut nya untuk up
1. Klik tanda plus
2. Isi Host dengan IP address PC proxy server kamu, contoh 192.168.30.2
3. Interval 00:00:01
4. Time Out isikan saja 1000 ms
5. Pada tab "UP" isikan :ip firewall nat enable 1
6. ok (simpan)