Page 1 of 1

Bandwidth Control

Posted: Sun Mar 01, 2009 2:03 pm
by ijuzba
Hello!
I am new to the forum and I just started working with MikroTik.
I have a lot of questions, most of it bothered me
bandwidth control is very inconvenient to me to share 60 user speed of 20Mbit / s download and 768 kbit / s upload.
Thus I did:]

/ip firewall mangle
add action=change-mss chain=forward comment="" disabled=no new-mss=clamp-to-pmtu out-interface=pppoe-out1 protocol=tcp \
tcp-flags=syn
add action=mark-routing chain=prerouting comment="" disabled=yes new-routing-mark=CASTOROCEOIP passthrough=yes \
src-address=172.16.0.5
add action=mark-packet chain=prerouting comment=icmp disabled=no in-interface=pppoe-out1 new-packet-mark=icmp_in \
passthrough=no protocol=icmp
add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=icmp_out out-interface=pppoe-out1 \
passthrough=no protocol=icmp
add action=mark-packet chain=prerouting comment=SNMP disabled=no in-interface=pppoe-out1 new-packet-mark=SNMP-IN \
passthrough=no protocol=udp src-port=161
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=161 new-packet-mark=SNMP-OUT out-interface=\
pppoe-out1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=p2p disabled=no in-interface=pppoe-out1 new-packet-mark=p2p_in p2p=all-p2p \
passthrough=no
add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=p2p_out out-interface=pppoe-out1 p2p=\
all-p2p passthrough=no
add action=mark-packet chain=prerouting comment=pop3 disabled=no in-interface=pppoe-out1 new-packet-mark=pop3_in \
passthrough=no protocol=tcp src-port=110
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=110 new-packet-mark=pop3_out out-interface=\
pppoe-out1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=smtp disabled=no in-interface=pppoe-out1 new-packet-mark=smtp_in \
passthrough=no protocol=tcp src-port=25
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=25 new-packet-mark=smtp_out out-interface=\
pppoe-out1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=winbox disabled=no dst-port=8291 in-interface=pppoe-out1 new-packet-mark=\
winbox_in passthrough=no protocol=tcp
add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=winbox_out out-interface=pppoe-out1 \
passthrough=no protocol=tcp src-port=8291
add action=mark-packet chain=prerouting comment=dns disabled=no in-interface=pppoe-out1 new-packet-mark=dns_in \
passthrough=no protocol=udp src-port=53
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=53 new-packet-mark=dns_out out-interface=\
pppoe-out1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=www disabled=no in-interface=pppoe-out1 new-packet-mark=www_in \
passthrough=no protocol=tcp src-port=80
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=80 new-packet-mark=www_out out-interface=\
pppoe-out1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=ssl disabled=no in-interface=pppoe-out1 new-packet-mark=ssl_in \
passthrough=no protocol=tcp src-port=443
add action=mark-packet chain=postrouting comment="" disabled=no dst-port=443 new-packet-mark=ssl_out out-interface=\
pppoe-out1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=udp disabled=no in-interface=pppoe-out1 new-packet-mark=udp_in \
passthrough=no protocol=udp
add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=udp_out out-interface=pppoe-out1 \
passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=tcp disabled=no in-interface=pppoe-out1 new-packet-mark=tcp_in \
passthrough=no protocol=tcp
add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=tcp_out out-interface=pppoe-out1 \
passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=other disabled=no in-interface=pppoe-out1 new-packet-mark=other_in \
passthrough=no
add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=other_out out-interface=pppoe-out1 \
passthrough=no

-----------------------------------------------------------------------------------
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=768000 name=upload_wan1 packet-mark="" \
parent=global-out priority=8 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=winbox_down packet-mark=\
winbox_in parent=global-in priority=1 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=winbox_up packet-mark=winbox_out \
parent=global-out priority=1 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=dns_down packet-mark=dns_in \
parent=global-in priority=2 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=dns_up packet-mark=dns_out \
parent=global-out priority=2 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=www_up packet-mark=www_out \
parent=upload_wan1 priority=2 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=ssl_up packet-mark=ssl_out \
parent=upload_wan1 priority=1 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=p2p_up packet-mark=p2p_out \
parent=upload_wan1 priority=8 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=udp_up packet-mark=udp_out \
parent=upload_wan1 priority=4 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=tcp_up packet-mark=tcp_out \
parent=upload_wan1 priority=6 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=other_up packet-mark=other_out \
parent=upload_wan1 priority=4 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=20000000 name=download_wan1 \
packet-mark="" parent=global-in priority=8 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=www_down packet-mark=www_in \
parent=download_wan1 priority=3 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=ssl_down packet-mark=ssl_in \
parent=download_wan1 priority=1 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=p2p_down packet-mark=p2p_in \
parent=download_wan1 priority=8 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=udp_down packet-mark=udp_in \
parent=download_wan1 priority=4 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=tcp_down packet-mark=tcp_in \
parent=download_wan1 priority=6 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=other packet-mark=other_in \
parent=download_wan1 priority=4 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=pop3_down packet-mark=pop3_in \
parent=download_wan1 priority=2 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=smtp_down packet-mark=smtp_in \
parent=download_wan1 priority=2 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=smtp_out packet-mark=smtp_out \
parent=upload_wan1 priority=3 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=pop3_up packet-mark=pop3_out \
parent=upload_wan1 priority=3 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=SNMP-IN packet-mark=SNMP-IN \
parent=global-in priority=3 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=SNMP-OUT packet-mark=SNMP-OUT \
parent=global-out priority=3 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=icmp-up packet-mark=icmp_out \
parent=global-out priority=1 queue=wireless-default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=icmp-down packet-mark=icmp_in \
parent=global-in priority=1 queue=wireless-defaul

---------------------------------------------------------------
/queue type
add kind=pcq name=global-out pcq-classifier=src-address pcq-limit=50 \
pcq-rate=0 pcq-total-limit=2000
add kind=pcq name=global-in pcq-classifier=dst-address pcq-limit=50 pcq-rate=\
0 pcq-total-limit=2000

--------------------------------------------------------------

Has not shown me the best solution.
If we can tell someone where I am wrong???
Forgive me my bad English!

Thanks Ivan!

Re: Bandwidth Control

Posted: Mon Mar 02, 2009 11:25 pm
by xordi
Uhm... i'm doing the same what you...
This post can help you with some in your configuration.

http://forum.mikrotik.com/viewtopic.php?f=2&t=27555

I cannot help you because i could be wrong, but i'm starting too in MT.
Good Luck.