Автор данной статьи Григорьев Дмитрий (Inlarion)
http://habrahabr.ru/post/131295/
Доброго времени суток, сегодня речь пойдет о наболевшем, а именно о том, как грамотно разделить интернет канал, чтобы все ваши пользователи были максимально довольны.
Начнем с того, что я по традиции как и все остальные специалисты отправлю вас курить мануалы… Зачем? Да только для того чтобы вы хотя бы чуть-чуть образно представили как будут протекать процессы деления скорости. Потому что как показывает практика — любые действия без осознания принципов работы, приводит лишь к куче вопросов, потерянному времени и злому бухгалтеру, ну или директору у которого по вашей вине сегодня утром не открылась страничка с загорелыми блондинками :)
QoS включает несколько возможностей, в следующем порядке:ÂÂÂ
1. mangle chain prerouting
2. HTB global-in
3. Mangle chain forward
4. Mangle chain postrouting
5. HTB global-out
6. HTB out interface
поэтому в пределах одного роутера можно дважды шейпить трафик:ÂÂÂ
a) #1 и #2 для первой маркировки трафика и последующего шейпинга, и #3+#5 для второй
b) #1 и #2 для первой маркировки трафика и последующего шейпинга, и #3+#6 для второй
c) #1 и #2 для первой маркировки трафика и последующего шейпинга, и #4+#5 для второй
d) #1 и #2 для первой маркировки трафика и последующего шейпинга, и #4+#6 для второй
/ip firewall layer7-protocol
add name=Skype regexp="^..\\x02............."
add name=radmin regexp="^\\x01\\x01(\\x08\\x08|\\x1b\\x1b)\$"
add name=rdp regexp="rdp\r\
\nrdpdr.*cliprdr.*rdpsnd"
add name=http regexp="http/(0\\.9|1\\.0|1\\.1) [1-5][0-9][0-9]|post [\\x09-\\x\
0d -~]* http/[01]\\.[019]"
add name=Jabber regexp=\
"Пометим весь трафик в CLASS-D
/ip firewall mangle
add action=accept chain=forward comment=CLASS-D disabled=yes
add action=mark-connection chain=forward comment=ALLTRAFFIC disabled=no new-connection-mark=CLASS-D passthrough=yes
add action=mark-packet chain=forward comment=CLASS-D-GROUP-E-DL connection-mark=CLASS-D disabled=no dst-address-list=GROUP-E new-packet-mark=CLASS-D-GROUP-E-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-D-GROUP-D-DL connection-mark=CLASS-D disabled=no dst-address-list=GROUP-D new-packet-mark=CLASS-D-GROUP-D-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-D-GROUP-C-DL connection-mark=CLASS-D disabled=no dst-address-list=GROUP-C new-packet-mark=CLASS-D-GROUP-C-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-D-GROUP-B-DL connection-mark=CLASS-D disabled=no dst-address-list=GROUP-B new-packet-mark=CLASS-D-GROUP-B-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-D-GROUP-A-DL connection-mark=CLASS-D disabled=no dst-address-list=GROUP-A new-packet-mark=CLASS-D-GROUP-A-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=prerouting comment=CLASS-D-GROUP-E-UP connection-mark=CLASS-D disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-D-GROUP-E-UP passthrough=yes src-address-list=GROUP-E
add action=mark-packet chain=prerouting comment=CLASS-D-GROUP-D-UP connection-mark=CLASS-D disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-D-GROUP-D-UP passthrough=yes src-address-list=GROUP-D
add action=mark-packet chain=prerouting comment=CLASS-D-GROUP-C-UP connection-mark=CLASS-D disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-D-GROUP-C-UP passthrough=yes src-address-list=GROUP-C
add action=mark-packet chain=prerouting comment=CLASS-D-GROUP-B-UP connection-mark=CLASS-D disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-D-GROUP-B-UP passthrough=yes src-address-list=GROUP-B
add action=mark-packet chain=prerouting comment=CLASS-D-GROUP-A-UP connection-mark=CLASS-D disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-D-GROUP-A-UP passthrough=yes src-address-list=GROUP-A
add action=accept chain=forward comment=CLASS-D disabled=yes
Переразметим пакеты более высокого класса CLASS-C
add action=accept chain=forward comment=CLASS-C disabled=yes
add action=mark-connection chain=forward comment=Proxy disabled=no dst-port=3128 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=HTTP disabled=no layer7-protocol=http new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=HTTPS disabled=no dst-port=443 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=FTP disabled=no dst-port=20,21 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=SFTP disabled=no dst-port=22 new-connection-mark=CLASS-C packet-size=1400-1500 passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=SMTP disabled=no dst-port=25 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=SMTPS disabled=no dst-port=465 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=Imap disabled=no dst-port=143 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=POP3 disabled=no dst-port=110 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=POP3S disabled=no dst-port=995 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=IMAPS disabled=no dst-port=993 new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=GIF_FILE disabled=no layer7-protocol=GIF_FILE new-connection-mark=CLASS-C passthrough=yes
add action=mark-connection chain=forward comment=PNG_FILE disabled=no layer7-protocol=PNG_FILE new-connection-mark=CLASS-C passthrough=yes
add action=mark-connection chain=forward comment=CLASS-C-SITES disabled=no new-connection-mark=CLASS-C passthrough=yes src-address-list=CLASS-C-SITES
add action=mark-connection chain=forward comment=CLASS-C-SITES disabled=no dst-address-list=CLASS-C-SITES new-connection-mark=CLASS-C passthrough=yes
add action=mark-connection chain=forward comment="100Kb Connections" connection-bytes=0-100000 disabled=no new-connection-mark=CLASS-C passthrough=yes protocol=tcp
add action=mark-packet chain=forward comment=CLASS-C-GROUP-E-DL connection-mark=CLASS-C disabled=no dst-address-list=GROUP-E new-packet-mark=CLASS-C-GROUP-E-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-C-GROUP-D-DL connection-mark=CLASS-C disabled=no dst-address-list=GROUP-D new-packet-mark=CLASS-C-GROUP-D-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-C-GROUP-C-DL connection-mark=CLASS-C disabled=no dst-address-list=GROUP-C new-packet-mark=CLASS-C-GROUP-C-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-C-GROUP-B-DL connection-mark=CLASS-C disabled=no dst-address-list=GROUP-B new-packet-mark=CLASS-C-GROUP-B-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-C-GROUP-A-DL connection-mark=CLASS-C disabled=no dst-address-list=GROUP-A new-packet-mark=CLASS-C-GROUP-A-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=prerouting comment=CLASS-C-GROUP-E-UP connection-mark=CLASS-C disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-C-GROUP-E-UP passthrough=yes src-address-list=GROUP-E
add action=mark-packet chain=prerouting comment=CLASS-C-GROUP-D-UP connection-mark=CLASS-C disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-C-GROUP-D-UP passthrough=yes src-address-list=GROUP-D
add action=mark-packet chain=prerouting comment=CLASS-C-GROUP-C-UP connection-mark=CLASS-C disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-C-GROUP-C-UP passthrough=yes src-address-list=GROUP-C
add action=mark-packet chain=prerouting comment=CLASS-C-GROUP-B-UP connection-mark=CLASS-C disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-C-GROUP-B-UP passthrough=yes src-address-list=GROUP-B
add action=mark-packet chain=prerouting comment=CLASS-C-GROUP-A-UP connection-mark=CLASS-C disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-C-GROUP-A-UP passthrough=yes src-address-list=GROUP-A
add action=accept chain=forward comment=CLASS-C disabled=yes
Переразметим пакеты более высокого класса CLASS-B
add action=accept chain=forward comment=CLASS-B disabled=yes
add action=mark-connection chain=forward comment=ICQ disabled=no dst-port=5190 new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment="Mail.ru Agent" disabled=no dst-port=2041,2042 new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=Jabber disabled=no layer7-protocol=Jabber new-connection-mark=CLASS-B passthrough=yes
add action=mark-connection chain=forward comment=IRC disabled=no dst-port=6667-6669 new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=SSH disabled=no dst-port=22 new-connection-mark=CLASS-B packet-size=0-1400 passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=TELNET disabled=no dst-port=23 new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=SNMP disabled=no dst-port=161-162 new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=PPTP disabled=no dst-port=1723 new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=L2TP disabled=no dst-port=1701 new-connection-mark=CLASS-B passthrough=yes protocol=udp
add action=mark-connection chain=forward comment=GRE disabled=no new-connection-mark=CLASS-B passthrough=yes protocol=gre
add action=mark-connection chain=forward comment=Skype disabled=no layer7-protocol=Skype new-connection-mark=CLASS-B passthrough=yes
add action=mark-connection chain=forward comment=CLASS-B-SITES disabled=no new-connection-mark=CLASS-B passthrough=yes src-address-list=CLASS-B-SITES
add action=mark-connection chain=forward comment=CLASS-B-SITES disabled=no dst-address-list=CLASS-B-SITES new-connection-mark=CLASS-B passthrough=yes
add action=mark-connection chain=forward comment="50Kb Connections" connection-bytes=0-50000 disabled=no new-connection-mark=CLASS-B passthrough=yes protocol=tcp
add action=mark-packet chain=forward comment=CLASS-B-GROUP-E-DL connection-mark=CLASS-B disabled=no dst-address-list=GROUP-E new-packet-mark=CLASS-B-GROUP-E-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-B-GROUP-D-DL connection-mark=CLASS-B disabled=no dst-address-list=GROUP-D new-packet-mark=CLASS-B-GROUP-D-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-B-GROUP-C-DL connection-mark=CLASS-B disabled=no dst-address-list=GROUP-C new-packet-mark=CLASS-B-GROUP-C-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-B-GROUP-B-DL connection-mark=CLASS-B disabled=no dst-address-list=GROUP-B new-packet-mark=CLASS-B-GROUP-B-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-B-GROUP-A-DL connection-mark=CLASS-B disabled=no dst-address-list=GROUP-A new-packet-mark=CLASS-B-GROUP-A-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=prerouting comment=CLASS-B-GROUP-E-UP connection-mark=CLASS-B disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-B-GROUP-E-UP passthrough=yes src-address-list=GROUP-E
add action=mark-packet chain=prerouting comment=CLASS-B-GROUP-D-UP connection-mark=CLASS-B disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-B-GROUP-D-UP passthrough=yes src-address-list=GROUP-D
add action=mark-packet chain=prerouting comment=CLASS-B-GROUP-C-UP connection-mark=CLASS-B disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-B-GROUP-C-UP passthrough=yes src-address-list=GROUP-C
add action=mark-packet chain=prerouting comment=CLASS-B-GROUP-B-UP connection-mark=CLASS-B disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-B-GROUP-B-UP passthrough=yes src-address-list=GROUP-B
add action=mark-packet chain=prerouting comment=CLASS-B-GROUP-A-UP connection-mark=CLASS-B disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-B-GROUP-A-UP passthrough=yes src-address-list=GROUP-A
add action=accept chain=forward comment=CLASS-B disabled=yes
Переразметим пакеты более высокого класса CLASS-A
add action=accept chain=forward comment=CLASS-A disabled=yes
add action=mark-connection chain=forward comment=DNS disabled=no dst-port=53 new-connection-mark=CLASS-A passthrough=yes protocol=tcp src-port=53
add action=mark-connection chain=forward comment=DNS disabled=no dst-port=53 new-connection-mark=CLASS-A passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=DNS disabled=no dst-port=53 new-connection-mark=CLASS-A passthrough=yes protocol=udp
add action=mark-connection chain=forward comment=NNTP disabled=no dst-port=119 new-connection-mark=CLASS-A passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=Winbox disabled=no dst-port=8291 new-connection-mark=CLASS-A passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=ntp disabled=no dst-port=123 new-connection-mark=CLASS-A passthrough=yes protocol=udp
add action=mark-connection chain=forward comment=VNC disabled=no dst-port=5900-5901 new-connection-mark=CLASS-A passthrough=yes protocol=tcp
add action=mark-connection chain=forward comment=Radmin disabled=no layer7-protocol=radmin new-connection-mark=CLASS-A passthrough=yes
add action=mark-connection chain=forward comment=RDP disabled=no layer7-protocol=rdp new-connection-mark=CLASS-A passthrough=yes
add action=mark-connection chain=forward comment=PING disabled=no new-connection-mark=CLASS-A passthrough=yes protocol=icmp
add action=mark-connection chain=forward comment=CLASS-A-SITES disabled=no new-connection-mark=CLASS-A passthrough=yes src-address-list=CLASS-A-SITES
add action=mark-connection chain=forward comment=CLASS-A-SITES disabled=no dst-address-list=CLASS-A-SITES new-connection-mark=CLASS-A passthrough=yes
add action=mark-connection chain=forward comment="5Kb Connections" connection-bytes=0-5000 disabled=no new-connection-mark=CLASS-A passthrough=yes protocol=tcp
add action=mark-packet chain=forward comment=CLASS-A-GROUP-E-DL connection-mark=CLASS-A disabled=no dst-address-list=GROUP-E new-packet-mark=CLASS-A-GROUP-E-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-A-GROUP-D-DL connection-mark=CLASS-A disabled=no dst-address-list=GROUP-D new-packet-mark=CLASS-A-GROUP-D-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-A-GROUP-C-DL connection-mark=CLASS-A disabled=no dst-address-list=GROUP-C new-packet-mark=CLASS-A-GROUP-C-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-A-GROUP-B-DL connection-mark=CLASS-A disabled=no dst-address-list=GROUP-B new-packet-mark=CLASS-A-GROUP-B-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=forward comment=CLASS-A-GROUP-A-DL connection-mark=CLASS-A disabled=no dst-address-list=GROUP-A new-packet-mark=CLASS-A-GROUP-A-DL passthrough=yes src-address-list=!ShaperExclude
add action=mark-packet chain=prerouting comment=CLASS-A-GROUP-E-UP connection-mark=CLASS-A disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-A-GROUP-E-UP passthrough=yes src-address-list=GROUP-E
add action=mark-packet chain=prerouting comment=CLASS-A-GROUP-D-UP connection-mark=CLASS-A disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-A-GROUP-D-UP passthrough=yes src-address-list=GROUP-D
add action=mark-packet chain=prerouting comment=CLASS-A-GROUP-C-UP connection-mark=CLASS-A disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-A-GROUP-C-UP passthrough=yes src-address-list=GROUP-C
add action=mark-packet chain=prerouting comment=CLASS-A-GROUP-B-UP connection-mark=CLASS-A disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-A-GROUP-B-UP passthrough=yes src-address-list=GROUP-B
add action=mark-packet chain=prerouting comment=CLASS-A-GROUP-A-UP connection-mark=CLASS-A disabled=no dst-address-list=!ShaperExclude new-packet-mark=CLASS-A-GROUP-A-UP passthrough=yes src-address-list=GROUP-A
add action=accept chain=forward comment=CLASS-A disabled=yes
Теперь пожалуй стоит забить пустые адрес-листы, так, для красоты...
/ip firewall address-list
add address=192.168.0.1 disabled=no list=GROUP-A
add address=192.168.0.2 disabled=no list=GROUP-B
add address=192.168.0.4 disabled=no list=GROUP-D
add address=192.168.0.3 disabled=no list=GROUP-C
add address=192.168.0.5 disabled=no list=GROUP-E
add address=0.0.0.0 disabled=no list=CLASS-A-SITES
add address=0.0.0.0 disabled=no list=CLASS-B-SITES
add address=0.0.0.0 disabled=no list=CLASS-C-SITES
add address=192.168.0.0/16 disabled=no list=ShaperExclude
add address=10.0.0.0/8 disabled=no list=ShaperExclude
Теперь когда мы закончили с фаерволом, пришло время заняться типами очередей и посадить печень построить дерево.
Создадим типы очередей
/queue type
add kind=pcq name=GROUP-A-DL pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-B-DL pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-C-DL pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-D-DL pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-E-DL pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-A-UP pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=150 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-B-UP pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=150 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-C-UP pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=150 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-D-UP pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=150 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
add kind=pcq name=GROUP-E-UP pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 pcq-dst-address6-mask=64 pcq-limit=150 pcq-rate=0 pcq-src-address-mask=32 pcq-src-address6-mask=64 pcq-total-limit=2000
Обратите пристальное внимание что парамтр PCQ Rate ничем не ограничен, т.к. скорость подпотока я оставил на ваше усмотрение, по умолчанию максимальная скорость подпотока будет ограничена параметром Max.Limit деленого на количество подпотоков, разделенной по классам.
Строим дерево:
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=10M name=DOWNLOAD parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=10M name=UPLOAD parent=global-total priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-A-UP parent=UPLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AA-UP packet-mark=CLASS-A-GROUP-A-UP parent=GROUP-A-UP priority=1 queue=GROUP-A-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BA-UP packet-mark=CLASS-B-GROUP-A-UP parent=GROUP-A-UP priority=2 queue=GROUP-A-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CA-UP packet-mark=CLASS-C-GROUP-A-UP parent=GROUP-A-UP priority=3 queue=GROUP-A-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DA-UP packet-mark=CLASS-D-GROUP-A-UP parent=GROUP-A-UP priority=4 queue=GROUP-A-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-B-UP parent=UPLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AB-UP packet-mark=CLASS-A-GROUP-B-UP parent=GROUP-B-UP priority=2 queue=GROUP-B-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BB-UP packet-mark=CLASS-B-GROUP-B-UP parent=GROUP-B-UP priority=3 queue=GROUP-B-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CB-UP packet-mark=CLASS-C-GROUP-B-UP parent=GROUP-B-UP priority=4 queue=GROUP-B-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DB-UP packet-mark=CLASS-D-GROUP-B-UP parent=GROUP-B-UP priority=5 queue=GROUP-B-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-C-UP parent=UPLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AC-UP packet-mark=CLASS-A-GROUP-C-UP parent=GROUP-C-UP priority=3 queue=GROUP-C-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BC-UP packet-mark=CLASS-B-GROUP-C-UP parent=GROUP-C-UP priority=4 queue=GROUP-C-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CC-UP packet-mark=CLASS-C-GROUP-C-UP parent=GROUP-C-UP priority=5 queue=GROUP-C-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DC-UP packet-mark=CLASS-D-GROUP-C-UP parent=GROUP-C-UP priority=6 queue=GROUP-C-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-D-UP parent=UPLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AD-UP packet-mark=CLASS-A-GROUP-D-UP parent=GROUP-D-UP priority=4 queue=GROUP-D-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BD-UP packet-mark=CLASS-B-GROUP-D-UP parent=GROUP-D-UP priority=5 queue=GROUP-D-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CD-UP packet-mark=CLASS-C-GROUP-D-UP parent=GROUP-D-UP priority=6 queue=GROUP-D-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DD-UP packet-mark=CLASS-D-GROUP-D-UP parent=GROUP-D-UP priority=7 queue=GROUP-D-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-E-UP parent=UPLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AE-UP packet-mark=CLASS-A-GROUP-E-UP parent=GROUP-E-UP priority=5 queue=GROUP-E-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BE-UP packet-mark=CLASS-B-GROUP-E-UP parent=GROUP-E-UP priority=6 queue=GROUP-E-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CE-UP packet-mark=CLASS-C-GROUP-E-UP parent=GROUP-E-UP priority=7 queue=GROUP-E-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DE-UP packet-mark=CLASS-D-GROUP-E-UP parent=GROUP-E-UP priority=8 queue=GROUP-E-UP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-A-DL parent=DOWNLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AA-DL packet-mark=CLASS-A-GROUP-A-DL parent=GROUP-A-DL priority=1 queue=GROUP-A-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BA-DL packet-mark=CLASS-B-GROUP-A-DL parent=GROUP-A-DL priority=2 queue=GROUP-A-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CA-DL packet-mark=CLASS-C-GROUP-A-DL parent=GROUP-A-DL priority=3 queue=GROUP-A-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DA-DL packet-mark=CLASS-D-GROUP-A-DL parent=GROUP-A-DL priority=4 queue=GROUP-A-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-B-DL parent=DOWNLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AB-DL packet-mark=CLASS-A-GROUP-B-DL parent=GROUP-B-DL priority=2 queue=GROUP-B-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BB-DL packet-mark=CLASS-B-GROUP-B-DL parent=GROUP-B-DL priority=3 queue=GROUP-B-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CB-DL packet-mark=CLASS-C-GROUP-B-DL parent=GROUP-B-DL priority=4 queue=GROUP-B-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DB-DL packet-mark=CLASS-D-GROUP-B-DL parent=GROUP-B-DL priority=5 queue=GROUP-B-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-C-DL parent=DOWNLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AC-DL packet-mark=CLASS-A-GROUP-C-DL parent=GROUP-C-DL priority=3 queue=GROUP-C-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BC-DL packet-mark=CLASS-B-GROUP-C-DL parent=GROUP-C-DL priority=4 queue=GROUP-C-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CC-DL packet-mark=CLASS-C-GROUP-C-DL parent=GROUP-C-DL priority=5 queue=GROUP-C-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DC-DL packet-mark=CLASS-D-GROUP-C-DL parent=GROUP-C-DL priority=6 queue=GROUP-C-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-D-DL parent=DOWNLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AD-DL packet-mark=CLASS-A-GROUP-D-DL parent=GROUP-D-DL priority=4 queue=GROUP-D-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BD-DL packet-mark=CLASS-B-GROUP-D-DL parent=GROUP-D-DL priority=5 queue=GROUP-D-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CD-DL packet-mark=CLASS-C-GROUP-D-DL parent=GROUP-D-DL priority=6 queue=GROUP-D-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DD-DL packet-mark=CLASS-D-GROUP-D-DL parent=GROUP-D-DL priority=7 queue=GROUP-D-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=GROUP-E-DL parent=DOWNLOAD priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-AE-DL packet-mark=CLASS-A-GROUP-E-DL parent=GROUP-E-DL priority=5 queue=GROUP-E-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-BE-DL packet-mark=CLASS-B-GROUP-E-DL parent=GROUP-E-DL priority=6 queue=GROUP-E-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-CE-DL packet-mark=CLASS-C-GROUP-E-DL parent=GROUP-E-DL priority=7 queue=GROUP-E-DL
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=CLASS-DE-DL packet-mark=CLASS-D-GROUP-E-DL parent=GROUP-E-DL priority=8 queue=GROUP-E-DL
На этом можно сказать реализация закончена.
Еще я думаю стоит сказать о необходимости использования параметров Limit-at и Max-limit в каждой группе хотя бы из соображений того, что интернет нужен всем :)ÂÂÂ
Так же полезно настроить профили групп, опять пну вас в сторону презентации от Мегиса в которой говорится о размере очереди, задержках и потерях пакетов.
Еще дополнительно для новичков скажу пару слов: Данный набор правил абсолютно бесполезен если не задать в корняхDOWNLOAD и UPLOAD значения Max-Limit
Значения Max-Limit стоит ставить МЕНЬШЕ реальной скорости вашего канала в интернет процентов на 5-10, в противном случае настройка будет абсолютно бессмысленной, т.к. ваш провайдер будет дропать или задерживать пакеты которые не помещаются в выходной поток.
В общих чертах все, все остальное делается на вкус и цвет, изменение приоритета производится сменой метки соединения и перемещением правила по списку.
Добавление нового определенного типа аналогичным способом или банальным копированием правила с последующим перемещением и редактированием.
При наличии нескольких каналов, в параметре Max.Limit задается сумма скоростей этих каналов.
Для вашего удобства выкладываю RSC файл импорта в систему, а так же скриншоты для более полного представления работы. Пользуйтесь на здоровье!
Mangle
Полноразмерная пикча
Queue
Комментарии
Ну мы стараемся о приборах рассказывать )))))
И Вы ежели чего пишите на сайте...
RSS лента комментариев этой записи