edc Posted July 13, 2012 (edited) Прописал следующие правила: /ip firewall mangle add action=mark-packet chain=postrouting comment="Link-critical traffic (DHCP)" disabled=no dst-port=67 new-packet-mark=link_critical out-interface=ether1 passthrough=no protocol=udp src-port=68 add action=mark-packet chain=postrouting comment="VPN TCP" disabled=no new-packet-mark=link_critical out-interface= ether1 passthrough=no port=443,1723 protocol=tcp add action=mark-packet chain=postrouting comment="VPN GRE" disabled=no new-packet-mark=link_critical out-interface= ether1 passthrough=no protocol=gre add action=mark-packet chain=postrouting comment="VPN UDP" disabled=no new-packet-mark=link_critical out-interface= ether1 passthrough=no port=4500,500,1701 protocol=udp add action=mark-packet chain=postrouting comment="VPN ESP" disabled=no new-packet-mark=link_critical out-interface= ether1 passthrough=no protocol=ipsec-esp add action=mark-packet chain=postrouting comment="Time-critical traffic (DNS, TCP control packets, certain ACK packets, new connections)" disabled=no dst-port=53 new-packet-mark=time_critical out-interface= ether1 passthrough=no protocol=udp add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=time_critical out-interface= ether1 passthrough=no protocol=tcp tcp-flags=fin,syn,rst add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=time_critical out-interface= ether1 packet-size=40-89 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="" connection-state=new disabled=no new-packet-mark=time_critical out-interface= ether1 passthrough=no protocol=tcp add action=mark-packet chain=postrouting comment="Critical traffic (just some ACK packets)" disabled=no new-packet-mark=critical out-interface= ether1 packet-size=90-159 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="High-priority interactive traffic (SSH, WinBox, certain ACK packets)" disabled=no new-packet-mark=high_pri_interactive out-interface= ether1 passthrough=no port=22,2200 protocol=tcp add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=high_pri_interactive out-interface= ether1 passthrough=no port=8291 protocol=tcp add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=high_pri_interactive out-interface= ether1 packet-size=160-249 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="Low-priority interactive traffic (HTTP, HTTPS)" disabled=no new-packet-mark=low_pri_interactive out-interface= ether1 passthrough=no port=80 protocol=tcp add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=low_pri_interactive out-interface= ether1 packet-size=250-359 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="High-priority non-interactive traffic (FTP)" connection-type=ftp disabled=no new-packet-mark=high_pri_non_interactive out-interface= ether1 passthrough=no protocol=tcp add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=high_pri_non_interactive out-interface= ether1 packet-size=360-489 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="Low-priority non-interactive traffic (POP, SMTP)" disabled=no new-packet-mark=low_pri_non_interactive out-interface= ether1 passthrough=no port=25,110 protocol=tcp add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=low_pri_non_interactive out-interface= ether1 packet-size=490-639 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="Non-critical traffic (P2P)" disabled=no new-packet-mark=non_critical out-interface= ether1 packet-size=640-809 passthrough=no protocol=tcp tcp-flags=ack add action=mark-packet chain=postrouting comment="" disabled=no new-packet-mark=non_critical out-interface= ether1 passthrough=no protocol=tcp /queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name="Outgoing queue" packet-mark="" parent=ether1 priority=8 add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name="Low-pri non-interactive" packet-mark=low_pri_non_interactive parent="Outgoing queue" priority=7 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name=Non-critical packet-mark=non_critical parent="Outgoing queue" priority=8 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name=Link-critical packet-mark=link_critical parent="Outgoing queue" priority=1 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name=Time-critical packet-mark=time_critical parent="Outgoing queue" priority=2 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name=Critical packet-mark=critical parent="Outgoing queue" priority=3 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name="High-pri interactive" packet-mark=high_pri_interactive parent="Outgoing queue" priority=4 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name="Low-pri interactive" packet-mark=low_pri_interactive parent="Outgoing queue" priority=5 queue=default add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=9M name="High-pri non-interactive" packet-mark=high_pri_non_interactive parent="Outgoing queue" priority=6 queue=default Интерфейс провайдера ether1. Настроен NAT Скорость канала 10Мбит. Вижу, что HTTP, HTTPS трафик не маркируется. Не могу понять почему. Edited July 13, 2012 by edc Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
bel Posted July 14, 2012 (edited) HTTPS обычно идёт по 443/TCP порту, а в правиле указан только 80/TCP. И ещё меня смущает пробел после "out-interface=". Edited July 14, 2012 by bel Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Saab95 Posted July 14, 2012 Попробуйте использовать Forward и Output, если интернет раздает ваш же маршрутизатор, а не перенаправляет пакеты далее на другой. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
edc Posted July 16, 2012 Поставил parent=global-out - заработало. Но почему-то трафик ipsec туннелей никак не маркируется. Туннели настроены на этом же маршрутизаторе и используют ether1 интерфейс. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Saab95 Posted July 16, 2012 Так я же и говорю используйте chain=output, трафик же сам микротик генерит. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
edc Posted July 16, 2012 Если поставить output, то очень мало трафика маркируется. Больше всего, когда стоит postrouting. Можно как-то остальной трафик, кроме того, что указан в правилах, тоже маркировать и поставить низкий приоритет. Сейчас, как я понял, весь немаркированный трафик идет первым приоритетом. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Saab95 Posted July 16, 2012 Так вы одним правилом один трафик маркируйте, другим - другой. Отдельно входящий и отдельно исходящий. Если вы какой-то трафик не помаркировали, то он вообще идет помимо приоритетов. Поэтому нужно сделать правило маркировки, куда попадает весь трафик и пойдет по минимальному приоритету, у него галочку Passthrough не ставите. А все те, что маркируют конкретный трафик, делаете с этой галочкой. Тогда можно делать рабочие приоритеты без "утечек". Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
anesth Posted July 16, 2012 (edited) Может быть это сгодится Edited July 16, 2012 by anesth Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
viver Posted July 17, 2012 http://habrahabr.ru/post/131295/ Вот тут вот очень хорошо все расписано. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
edc Posted July 17, 2012 В конечном итоге так и сделал. Но если указать parent interface на downdload global-out, а на upload - global-in или global-total, то объем маркированных данных примерно одинаковый. Хотя в данный момент соотношение download/upload около порядка. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
a-zazell Posted July 20, 2012 Использую схему с dscp, маркировка в postrouting, правило примерно такого вида: add action=mark-packet chain=postrouting dscp=1 dst-address-list=local-net\ new-packet-mark=dscp_1 passthrough=no src-address-list=!local-net Если надо определенный трафик приоретизировать, то делаю так: add action=change-dscp chain=prerouting comment=p2p disabled=no new-dscp=0 p2p=all-p2p passthrough=yes В дереве очередей первое правило: /queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=12M name=IN parent=global-out priority=8 И вешаем на него: add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=dscp0 packet-mark=dscp_0 parent=IN priority=8 queue=pcq-in Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
edc Posted July 25, 2012 А есть у кого-то пример маркировки пакетов для протоколов H.323 и SIP ? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Saab95 Posted July 25, 2012 А есть у кого-то пример маркировки пакетов для протоколов H.323 и SIP ? Вы можете маркировать их по портам, но лучше по TOS. А дальше в стандартном дереве поставите им первый приоритет. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
edc Posted July 25, 2012 (edited) Ребят, не могу понять, почему трафик при такой конфигурации почти одинаковый на вход и выход Edited July 31, 2012 by edc Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
arastegaev Posted February 6, 2013 А есть у кого-то пример маркировки пакетов для протоколов H.323 и SIP ? Вы можете маркировать их по портам, но лучше по TOS. А дальше в стандартном дереве поставите им первый приоритет. А вот как этот злополучный tos определить? Снял трафик tools/packet sniffer а затем загружаю его в wireshark А дальше "темнота" ..... или есть метод попроще? Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...
Saab95 Posted June 24, 2014 А вот как этот злополучный tos определить? Снял трафик tools/packet sniffer а затем загружаю его в wireshark А дальше "темнота" ..... или есть метод попроще? Поискать в гугле стандартные метки телефонии, далее в манглах попробовать вводить их и смотреть попадают под него пакеты или нет. Если времени свободного много, можно в экселе накопировать правил, увеличивая значение на 1, после чего вставить в микротик, так сможете тоже найти. Вставить ник Quote Ответить с цитированием Share this post Link to post Share on other sites More sharing options...