Níže můžete vidět pravidla, která mám v mangle. Ten model routerboardu je skutečně ten, co jsem napsal, protože jsem to zkopíroval přímo z winboxu. Co se týká potřeby těch pravidel, dokud jsem je neměl vytvořené, nešlo mi pořádně přehrávat ani internetové rádio. Když jsem třeba stahoval aktualizace do mobilu, začalo rádio škytat a pak se to utrhlo úplně. Je pravda, že to dělalo na wifině, ale takové rozdělení podle služeb je asi potřeba v každé síti.
/ip firewall mangle
add action=jump chain=prerouting comment="Odskok na chain Sitove sluzby z duvo du oznaceni spojeni vsech sitovych sluzeb" connection-state=new jump-target="Sitove sluzby"
add action=add-dst-to-address-list address-list=Skype address-list-timeout= 1w3d chain=prerouting comment= "Komunikace VoIP v realtime provozu - Skype" connection-state=new dst-address-list=!Lokalni_adresy dst-port=80,443,1024-65535 layer7-protocol="Skype ACK" protocol=tcp
add action=add-dst-to-address-list address-list=Skype address-list-timeout= 1w3d chain=prerouting connection-state=new dst-address-list= !Lokalni_adresy dst-port=80,443,1024-65535 layer7-protocol= "Skype to Skype" protocol=tcp
add action=add-dst-to-address-list address-list=Skype address-list-timeout= 1w3d chain=prerouting connection-state=new dst-address-list= !Lokalni_adresy dst-port=80,443,1024-65535 layer7-protocol= "Skype to Skype" protocol=udp
add action=mark-connection chain=prerouting connection-state=new dst-address-list=Skype new-connection-mark=Skype passthrough=no protocol= tcp
add action=mark-connection chain=prerouting connection-state=new dst-address-list=Skype new-connection-mark=Skype passthrough=no protocol= udp
add action=mark-connection chain=prerouting comment= "Komunikace VoIP v realtime provozu - WhatsApp" connection-state=new dst-address-list=WhatsApp dst-port=80,443,4244,5222,5223,5228,5242 new-connection-mark=WhatsApp passthrough=no protocol=tcp
add action=mark-connection chain=prerouting connection-state=new dst-address-list=WhatsApp dst-port=80,443,4244,5222,5223,5228,5242 new-connection-mark=WhatsApp passthrough=no protocol=udp
add action=mark-connection chain=prerouting comment= "Komunikace VoIP v realtime provozu - protokol SIP" connection-state=new dst-port=5060,5061,5064 layer7-protocol=SIP new-connection-mark=SIP passthrough=no protocol=tcp
add action=mark-connection chain=prerouting connection-state=new dst-port= 5060,5061,5064 layer7-protocol=SIP new-connection-mark=SIP passthrough=no protocol=udp
add action=mark-connection chain=prerouting comment= "Realtime provoz - prehravani audio streamu" dst-port=80,443,8000 layer7-protocol="Audio playback" new-connection-mark="Audio stream" passthrough=no protocol=tcp
add action=mark-connection chain=prerouting connection-state=new dst-port= 8000 new-connection-mark="Audio stream" passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Realtime provoz - prehravani video streamu" dst-port=80,443 layer7-protocol="Video playback" new-connection-mark="Video stream" passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Realtime provoz - UPnP (DLNA)" connection-state=new new-connection-mark= DLNA passthrough=no port=2869,50002,50001 protocol=tcp
add action=mark-connection chain=prerouting connection-state=new dst-port= 1900 new-connection-mark=DLNA passthrough=no protocol=udp
add action=mark-connection chain=prerouting comment= "Prehravani medialniho obsahu z mistniho NAS serveru na KODI" connection-state=new dst-address=10.0.3.100 dst-port=137-139,445,3020 new-connection-mark=DLNA passthrough=no protocol=tcp src-address= 10.0.3.10
add action=mark-connection chain=prerouting comment= "Komunikacni sluzby - protokol HTTP(S)" connection-bytes=0-1000000 connection-state=new dst-port=80,443 new-connection-mark="HTTP a HTTPS" passthrough=no protocol=tcp
add action=mark-connection chain=prerouting connection-bytes=0-1000000 connection-state=new dst-port=80,443 new-connection-mark="HTTP a HTTPS" passthrough=no protocol=udp
add action=mark-connection chain=prerouting comment="Komunikacni sluzby - spra va a administrace ruznych zarizeni (NAS, router, KODI a jine)" connection-bytes=0-1000000 connection-state=new dst-port= 5000,5001,8291,9090 new-connection-mark=Administrace passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Komunikacni sluzby - protokoly POP3, IMAP, SMTP" connection-state=new dst-port=25,110,143,993,995 new-connection-mark="POP3, IMAP, SMTP" passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Datovy provoz - protokol SMB" connection-state=new dst-port= 137-139,445,3020 new-connection-mark=SMB passthrough=no protocol=tcp
add action=mark-connection chain=prerouting connection-state=new dst-port= 137-139,445,3020 new-connection-mark=SMB passthrough=no protocol=udp
add action=mark-connection chain=prerouting comment= "Datovy provoz - protokol FTP" connection-state=new dst-port=20,21 new-connection-mark=FTP passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Datovy provoz - protokol TFTP" connection-state=new dst-port=69,1758 new-connection-mark=TFTP passthrough=no protocol=udp
add action=mark-connection chain=prerouting comment= "Datovy provoz - protokol SSH, SCP, SFTP" connection-state=new dst-port= 22 new-connection-mark=SSH passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Datovy provoz - protokol HTTP (download)" connection-bytes=1000000-0 connection-mark="HTTP a HTTPS" dst-port=80,443,5000,5001 new-connection-mark="HTTP download" passthrough=no protocol=tcp
add action=mark-connection chain=prerouting comment= "Datovy provoz - Windows Update a Google Play" connection-state=new dst-port=5223,5228,8530,8531 new-connection-mark=Aktualizace passthrough= no protocol=tcp
add action=mark-connection chain=prerouting comment= "Ostatni provoz - Peer to Peer (Bittorrent)" connection-state="" new-connection-mark="Peer to peer" passthrough=no port=55000 protocol=udp
add action=mark-connection chain=prerouting comment= "Ostatni nespecifikovany a neoznaceny provoz" connection-mark=no-mark connection-state=new new-connection-mark="Ostatni provoz" passthrough=no
add action=jump chain=output comment="Pravidlo pro oznaceni veskereho odchozih o provozu ze samotneho routeru (obvykle sitove sluzby) - odskok na chain S itove sluzby" connection-state=new jump-target="Sitove sluzby"
add action=mark-packet chain=postrouting comment="Pravidla pro oznaceni jednot livych paketu podle znacky spojeni - ostatni provoz" connection-mark= "Ostatni provoz" new-packet-mark="Ostatni provoz" passthrough=yes
add action=mark-packet chain=postrouting connection-mark="Peer to peer" new-packet-mark="Ostatni provoz" passthrough=yes
add action=mark-packet chain=postrouting comment="Pravidla pro oznaceni jednot livych paketu podle znacky spojeni - datovy provoz" connection-mark=SMB new-packet-mark="Datovy provoz" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=FTP new-packet-mark= "Datovy provoz" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=TFTP new-packet-mark="Datovy provoz" passthrough=yes
add action=mark-packet chain=postrouting connection-mark="HTTP download" new-packet-mark="Datovy provoz" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=Aktualizace new-packet-mark="Datovy provoz" passthrough=yes
add action=mark-packet chain=postrouting comment="Pravidla pro oznaceni jednot livych paketu podle znacky spojeni - komunikacni sluzby" connection-mark= "HTTP a HTTPS" new-packet-mark="Komunikacni sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=Administrace new-packet-mark="Komunikacni sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark="POP3, IMAP, SMTP" new-packet-mark="Komunikacni sluzby" passthrough=yes
add action=mark-packet chain=postrouting comment="Pravidla pro oznaceni jednot livych paketu podle znacky spojeni - prehravani audio a video streamu" connection-mark="Audio stream" new-packet-mark=Audio-video passthrough= yes
add action=mark-packet chain=postrouting connection-mark="Video stream" new-packet-mark=Audio-video passthrough=yes
add action=mark-packet chain=postrouting connection-mark=DLNA new-packet-mark=Audio-video passthrough=yes
add action=mark-packet chain=postrouting comment="Pravidla pro oznaceni jednot livych paketu podle znacky spojeni - realtime VoIP komunikace" connection-mark=Skype new-packet-mark=VoIP passthrough=yes
add action=mark-packet chain=postrouting connection-mark=WhatsApp new-packet-mark=VoIP passthrough=yes
add action=mark-packet chain=postrouting connection-mark=SIP new-packet-mark= VoIP passthrough=yes
add action=mark-packet chain=postrouting comment="Pravidla pro oznaceni jednot livych paketu podle znacky spojeni - sitove sluzby" connection-mark=DNS new-packet-mark="Sitove sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=DHCP new-packet-mark="Sitove sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=ICMP new-packet-mark="Sitove sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=IGMP new-packet-mark="Sitove sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=NTP new-packet-mark= "Sitove sluzby" passthrough=yes
add action=mark-packet chain=postrouting connection-mark=MNDP new-packet-mark="Sitove sluzby" passthrough=yes
add action=set-priority chain=postrouting comment="Pravidlo pro nastaveni prio rity jednotlivych paketu podle znacky paketu pro Peer to Peer a ostatni ne specifikovany a neoznaceny provoz" new-priority=0 packet-mark= "Ostatni provoz" passthrough=yes
add action=set-priority chain=postrouting comment="Pravidlo pro nastaveni prio rity jednotlivych paketu podle znacky paketu pro datovy provoz - SMB, FTP, \_CIFS a podobne" new-priority=1 packet-mark="Datovy provoz" passthrough= yes
add action=set-priority chain=postrouting comment="Pravidlo pro nastaveni prio rity jednotlivych paketu podle znacky paketu pro komunikacni sluzby" new-priority=3 packet-mark="Komunikacni sluzby" passthrough=yes
add action=set-priority chain=postrouting comment="Pravidlo pro nastaveni prio rity jednotlivych paketu podle znacky paketu pro streamovani, prehravani a udio a video a podobne" new-priority=4 packet-mark=Audio-video passthrough=yes
add action=set-priority chain=postrouting comment="Pravidlo pro nastaveni prio rity jednotlivych paketu podle znacky paketu pro VoIP komunikace v realtim e provozu - Skype, WhatsApp a podobne" new-priority=5 packet-mark=VoIP passthrough=yes
add action=set-priority chain=postrouting comment="Pravidlo pro nastaveni prio rity jednotlivych paketu podle znacky paketu pro vsechny sitove sluzby" new-priority=7 packet-mark="Sitove sluzby" passthrough=yes
add action=change-dscp chain=postrouting comment= "Pravidlo pro zmenu DSCP dle nastavene priority" new-dscp= from-priority-to-high-3-bits passthrough=yes
add action=mark-connection chain="Sitove sluzby" comment= "Sitove sluzby - protokol DNS" dst-port=53 new-connection-mark=DNS passthrough=no protocol=udp
add action=mark-connection chain="Sitove sluzby" comment= "Sitove sluzby - protokol DHCP" dst-port=67,68 new-connection-mark=DHCP passthrough=no protocol=udp
add action=mark-connection chain="Sitove sluzby" comment= "Sitove sluzby - protokol ICMP" new-connection-mark=ICMP passthrough=no protocol=icmp
add action=mark-connection chain="Sitove sluzby" comment= "Sitove sluzby - protokol IGMP" new-connection-mark=IGMP passthrough=no protocol=igmp
add action=mark-connection chain="Sitove sluzby" comment= "Sitove sluzby - protokol NTP" dst-port=123 new-connection-mark=NTP passthrough=no protocol=udp
add action=mark-connection chain="Sitove sluzby" comment= "Sitove sluzby - protokol MNDP" dst-port=5678 new-connection-mark=MNDP passthrough=no protocol=udp