SHOREWALL-TCPRI(5)
β¨ SHOREWALL-TCPRI(5) β¨
okay so bestie, you've landed on the shorewall-tcpri page β section 5, the Configuration Files corner of the manual. this is the girl that tells your packets who gets to go first. no cap, it's giving traffic-shaping royalty. π
πΈ NAME πΈ
tcpri β the Shorewall file. that's it. that's the name. short, sweet, iconic. π
π¦ SYNOPSIS π¦
/etc/shorewall[6]/tcpri
π DESCRIPTION π
so this file? it's where you specify the priority of traffic for simple traffic shaping. "simple" as in TC_ENABLED=Simple over in shorewall.conf[1](5). yes, it's a whole vibe. π
Starting with Shorewall 5.2.7, this file also allows ?FORMAT 2, which straight up inserts a SPORT column immediately to the right of the DPORT column. glow up fr fr. β¨
here's the tea on how the priority band actually gets picked: the last entry that the packet matches wins. that's it. last one standing, main character energy. and if a packet doesn't match any entry in this file at all? then its priority gets determined by its TOS field. π
the default mapping is right here below, but heads up β you can change it by setting the TC_PRIOMAP option in shorewall.conf[1](5).
TOS Bits Means Linux Priority BAND
------------------------------------------------------------
0x0 0 Normal Service 0 Best Effort 2
0x2 1 Minimize Monetary Cost 1 Filler 3
0x4 2 Maximize Reliability 0 Best Effort 2
0x6 3 mmc+mr 0 Best Effort 2
0x8 4 Maximize Throughput 2 Bulk 3
0xa 5 mmc+mt 2 Bulk 3
0xc 6 mr+mt 2 Bulk 3
0xe 7 mmc+mr+mt 2 Bulk 3
0x10 8 Minimize Delay 6 Interactive 1
0x12 9 mmc+md 6 Interactive 1
0x14 10 mr+md 6 Interactive 1
0x16 11 mmc+mr+md 6 Interactive 1
0x18 12 mt+md 4 Int. Bulk 2
0x1a 13 mmc+mt+md 4 Int. Bulk 2
0x1c 14 mr+mt+md 4 Int. Bulk 2
0x1e 15 mmc+mr+mt+md 4 Int. Bulk 2
and now, the columns. one by one, bestie, because we don't skip. π«Ά
BANDβ{1|2|3}classifies matching traffic as High Priority (1), Medium Priority (2) or Low Priority (3). for those interfaces listed over inshorewall-tcinterfaces[2](5), Priority 2 traffic will be deferred so long as there is Priority 1 traffic queued, and Priority 3 traffic will be deferred so long as there is Priority 1 or Priority 2 traffic to send. yes queen, the queue is a whole social hierarchy. πPROTOβprotocol[,...]Optional. the name or number of an IPv4 protocol. Beginning with Shorewall 4.5.12, this column can accept a comma-separated list of protocols. glow up again. β¨DPORTβport [,...]this column was namedPORTprior to Shorewall 5.2.7. both'port'and'dport'may be used in thealternate input format[3]. Optional. may only be given if the PROTO isTCP (6),UDP (17),DCCP (33),SCTP (132)orUDPLITE (136). it's a list of one or more port numbers or service names from/etc/services. port ranges of the formlowport:highportmay also be included. in format 1, packets whose source or destination port matches the specified port(s) are assigned to the band given in theBANDcolumn.SPORTβport [,...]only present in file format 2! Optional. may only be given if the PROTO isTCP (6),UDP (17),DCCP (33),SCTP (132)orUDPLITE (136). a list of one or more port numbers or service names from/etc/services. port ranges of the formlowport:highportmay also be included.ADDRESSβ[address]Optional. the IP or MAC address that the traffic originated from. MAC addresses must be given in Shorewall format. β οΈ if this column contains an address, then thePROTO,PORT(S)andINTERFACEcolumn must be empty ("-").INTERFACEβ[interface]Optional. the logical name of an interface that traffic arrives from. if given, thePROTO,PORT(S)andADDRESScolumns must be empty ("-").
Note π INTERFACE classification of packets happens before classification by PROTO/PORT(S)/ADDRESS. so it is highly recommended to place entries that specify INTERFACE at the top of the file, so that the rule about "last entry matches" is preserved. don't be the girl who breaks her own rule. π
HELPERβ[helper]Optional. names a Netfilter protocol helper module such asftp,sip,amanda, etc. a packet will match if it was accepted by the named helper module. you can also append"-"and a port number to the helper module name (e.g.,ftp-21) to specify the port number that the original connection was made on. π§
π FILES π
/etc/shorewall/tcpri/etc/shorewall6/tcpri
π SEE ALSO π
π NOTES π
- shorewall.conf
https://shorewall.org/manpages/shorewall.conf.html - shorewall-tcinterfaces
https://shorewall.org/manpages/shorewall-tcinterfaces.html - alternate input format
https://shorewall.org/configuration_file_basics.htm#Pairs
and that's the whole page, bestie. π this was the Configuration Files girlie, dated 09/24/2020, filed under SHOREWALL-TCPRI(5). go shape some traffic. slay. β¨ππ¦
π¦ where this page comes from
- alpine 3.22: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.23: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.24: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- debian bookworm: shorewall 5.2.8-2 Β· GPL-2.0-or-later
- debian trixie: shorewall 5.2.8-6 Β· GPL-2.0-or-later
- fedora 43: shorewall 5.2.8-17.fc43 Β· GPL-2.0-or-later
- fedora 44: shorewall 5.2.8-18.fc44 Β· GPL-2.0-or-later
- nixos 26.05: shorewall 5.2.8
- nixpkgs unstable: shorewall 5.2.8
- ubuntu noble: shorewall 5.2.8-5 Β· GPL-2.0-or-later
- ubuntu questing: shorewall 5.2.8-6
- ubuntu resolute: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms