AF Pembagian Bandwith Warnet per Client ~ dynamicSainsIT

Kamis, 30 Januari 2014

Pembagian Bandwith Warnet per Client

Tulisan ini hanya sekedar sharing untuk implementasi penggunaan Queue Tree diwarnet, dengan asumsi bahwa koneksi internet 2Mbps stabil (tidak naek turun) kesemua site, jumlah PC adalah 12 unit share maximum 1Mbps/pc (naek dan turun dengan otomatis jika user yang menggunakan bertambah, jika hanya 1 dan 2 user maka bandwith akan mentok di 1Mbps untuk tiap user).

Kondisi jaringan ip lan router=192.168.0.14, billing server=192.168.0.13, asumsi billing server juga digunakan operator untuk ngenet.

Tambahkan ip address pada lan router
ip address add address=192.168.0.14/28 interface=lan

Kemudian kita lakukan marking connection pada setiap pc-client
ip firewall mangle add action mark-connection new-connection-mark=pc01 src-address=192.168.0.1 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc02 src-address=192.168.0.2 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc03 src-address=192.168.0.3 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc04 src-address=192.168.0.4 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc05 src-address=192.168.0.5 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc06 src-address=192.168.0.6 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc07 src-address=192.168.0.7 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc08 src-address=192.168.0.8 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc09 src-address=192.168.0.9 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc10 src-address=192.168.0.10 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc11 src-address=192.168.0.11 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=pc12 src-address=192.168.0.12 chain=prerouting

ip firewall mangle add action mark-connection new-connection-mark=op src-address=192.168.0.13 chain=prerouting

Lakukan marking packet dari setiap connection yang terjadi
ip firewall mangle add action=mark-packet new-packet-mark=pc01 connection-mark=pc01 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc02 connection-mark=pc02 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc02 connection-mark=pc03 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc03 connection-mark=pc03 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc04 connection-mark=pc04 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc05 connection-mark=pc05 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc06 connection-mark=pc06 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc07 connection-mark=pc07 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc08 connection-mark=pc08 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc09 connection-mark=pc09 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc10 connection-mark=pc10 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc11 connection-mark=pc11 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=pc12 connection-mark=pc12 chain=prerouting passtrough=no

ip firewall mangle add action=mark-packet new-packet-mark=op connection-mark=op chain=prerouting passtrough=no

Tambahkan queue tree yang digunakan parent pada interface lan agar bandwith bisa terbagi rata
queue tree add parent=lan max-limit=2M name=Downlink

Tambahan penggunaan PCQ agar setting lebih maximal lagi
queue type add name=PCQ-1Mbps kind=pcq pcq-rate=1024k pcq-classifier=dst-address

Tambahkan child pada parent sesuai dengan packet mark
queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc01 packet-mark=pc01 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc02 packet-mark=pc02 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc03 packet-mark=pc03 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc04 packet-mark=pc04 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc05 packet-mark=pc05 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc06 packet-mark=pc06 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc07 packet-mark=pc07 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc08 packet-mark=pc08 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc09 packet-mark=pc09 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc10 packet-mark=pc10 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc11 packet-mark=pc11 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=pc12 packet-mark=pc12 queue=PCQ-1Mbps

queue tree add parent=Downlink limit-at=128k max-limit=1024k name=op packet-mark=op queue=PCQ-1Mbps

Maka setelah itu bandwith akan tershapping rata kepada setiap user, ini hanya sekedar share, untuk mengembangkan lebih jauh silahkan trial dan error sendiri

0 komentar:

Posting Komentar