Manual:Queues - PCQ Examples: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
1. Mark all packets with packet-mark all: | 1. Mark all packets with packet-mark all: | ||
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no | /ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no | ||
2. Setup two PCQ queue types - one for download and one for upload. dst-address is classifier for user's download traffic, src-address for upload traffic: | 2. Setup two PCQ queue types - one for download and one for upload. dst-address is classifier for user's download traffic, src-address for upload traffic: | ||
/queue type name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address | /queue type name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address | ||
/queue type name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address | /queue type name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address | ||
3. Finally, two queue rules required: | 3. Finally, two queue rules required: | ||
/queue tree add parent=global-in queue=PCQ-download packet-mark=all | /queue tree add parent=global-in queue=PCQ-download packet-mark=all | ||
/queue tree add parent=global-out queue=PCQ-upload packet-mark=all | /queue tree add parent=global-out queue=PCQ-upload packet-mark=all |
Revision as of 08:51, 5 January 2006
Same bandwidth for network users
In cases when you need to limit users to a specific bandwidth, you may use PCQ queues. We will limit all users to 64kbps download and 32kbps upload:
1. Mark all packets with packet-mark all:
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no
2. Setup two PCQ queue types - one for download and one for upload. dst-address is classifier for user's download traffic, src-address for upload traffic:
/queue type name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address /queue type name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address
3. Finally, two queue rules required:
/queue tree add parent=global-in queue=PCQ-download packet-mark=all /queue tree add parent=global-out queue=PCQ-upload packet-mark=all