SHOREWALL-TCDEVICES(5)
πΈ NAME πΈ
okay so bestie, this is the Shorewall Traffic Shaping Devices file β yes, the man page is SHOREWALL-TCDEVICES(5) and it lives in the Configuration Files section of your manual π
. The actual command/page name is tcdevices and she is the file that decides how fast your interfaces are allowed to go.
π¦ SYNOPSIS π¦
/etc/shorewall[6]/tcdevices
β¨ DESCRIPTION β¨
The entries in this file define the bandwidth for interfaces where you want traffic shaping turned on. That's it, that's the job π.
If you do not plan to use traffic shaping for a device, do NOT put it in here β because being in this file literally limits that device's throughput to whatever limits you wrote down. No take-backs, it's giving handcuffs π.
π a lil note on bandwidth definitions (read this, fr fr)
- do not put a space between the integer value and the unit:
30kbitis valid while30 kbitis not. the space ruins everything, it's giving sabotage π - you can use one of these units:
kbpsβ Kilobytes per second.mbpsβ Megabytes per second.kbitβ Kilobits per second.mbitβ Megabits per second.bpsor number β Bytes per second.
- Only whole integers are allowed. no decimals bestie, we don't do fractions here π§
π the columns
okay so the columns in the file are as follows (and where the column name is followed by a different name in parentheses, that different name is the one used in the alternate specification syntax π).
INTERFACE β [number:]interface
Name of interface. Each interface may be listed only once in this file. You may NOT specify the name of an alias here (like eth0:0, no ma'am) β see https://shorewall.org/FAQ.htm#faq18[1].
You may NOT specify wildcards here either! So if you've got a bunch of ppp interfaces, you gotta put them all in here, every single one, no shortcuts π.
If the device doesn't exist, a warning message will be issued during "shorewall [re]start" and "shorewall reload", and traffic shaping configuration will be skipped for that device. she just moves on π
.
Shorewall assigns a sequential interface number to each interface (first entry in the file is interface 1, second is interface 2, and so on and so on). You can explicitly specify the interface number by prefixing the interface name with the number and a colon (":"). Example: 1:eth0.
IN-BANDWIDTH (in_bandwidth) β {-|bandwidth[:burst]|~bandwidth[:interval:decay_interval]}
The incoming bandwidth of that interface. Now listen β you are not able to do traffic shaping on incoming traffic, because the traffic is already received before you could do anything about it π. But this does let you define the maximum traffic allowed for this interface in total, and if the rate is exceeded, the packets get dropped. You mainly want this if you've got a DSL or Cable connection, to avoid queuing at your provider's side.
If you don't want any traffic to be dropped, set this to a value of zero β in which case Shorewall will not create an ingress qdisc. Must be set to zero if the REDIRECTED INTERFACES column is non-empty.
The optional burst option was added in Shorewall 4.4.18. The default burst is 10kb. A larger burst can help make the bandwidth more accurate; often for fast lines, the enforced rate is well below the specified bandwidth. lowkey important π«Ά.
What's described above creates a rate/burst policing filter. Beginning with Shorewall 4.4.25, a rate-estimated policing filter may be configured instead. Rate-estimated filters should be used with Ethernet adapters that have Generic Receive Offload enabled by default. See Shorewall FAQ 97a[2].
To create a rate-estimated filter, precede the bandwidth with a tilde ("~"). The optional interval and decay_interval determine how often the rate is estimated and how many samples are retained for estimating. Please see http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txt for details. If not specified, the default interval is 250ms and the default decay_interval is 4sec β±οΈ.
OUT-BANDWIDTH (out_bandwidth) β bandwidth
The outgoing bandwidth of that interface. This is the maximum speed your connection can handle. It's also the speed you can refer to as "full" if you define the tc classes in shorewall-tcclasses[3](5). Outgoing traffic above this rate will be dropped π«£.
OPTIONS β {-|{classify|htb|hfsc|linklayer={ethernet|atm|adsl}|tsize=tsize|mtu=mtu|mpu=mpu|overhead=overhead},...}
classifyβ When specified, Shorewall will not generate tc or Netfilter rules to classify traffic based on packet marks. You must do all classification usingCLASSIFYrules inshorewall-mangle[4](5). all you, bestie β¨.connmarkβ Added in Shorewall 5.2.7. May only be specified if theREDIRECTED_INTERFACEScolumn is non-empty. It allows packet marks to be used to classify traffic for these interfaces.htbβ Use the Hierarchical Token Bucket queuing discipline. This is the default. she's the main character π.hfscβ Shorewall normally uses the Hierarchical Token Bucket queuing discipline. Whenhfscis specified, the Hierarchical Fair Service Curves discipline is used instead (seetc-hfsc(7)).linklayerβ Added in Shorewall 4.5.6. Type of link (ethernet,atm,adsl). When specified, causes scheduler packet size manipulation as described intc-stab(8). When this option is given, the following options may also be given after it:mtu=mtuβ The device MTU; default2048(will be rounded up to a power of two)mpu=mpubytesβ Minimum packet size used in calculations. Smaller packets will be rounded up to this sizetsize=tablesizeβ Size table entries; default is512overhead=overheadbytesβ Number of overhead bytes per packet.
REDIRECTED INTERFACES (redirect) β [interface[,interface]...]
May only be specified if the interface in the INTERFACE column is an Intermediate Frame Block (IFB) device. Causes packets that enter each listed interface to be passed through the egress filters defined for this device, thus providing a form of incoming traffic shaping π«. When this column is non-empty, the classify option is assumed unless the connmark option is specified.
π₯ EXAMPLES π₯
Example 1:
Suppose you're using PPP over Ethernet (DSL) and ppp0 is the interface for this. The device has an outgoing bandwidth of 500kbit and an incoming bandwidth of 6000kbit:
#INTERFACE IN-BANDWIDTH OUT-BANDWIDTH OPTIONS REDIRECTED
# INTERFACES
1:ppp0 6000kbit 500kbit
π FILES π
/etc/shorewall/tcdevices/etc/shorewall6/tcdevices
π SEE ALSO π
tc-hfsc(7)https://shorewall.org/traffic_shaping.htm[5]https://shorewall.org/configuration_file_basics.htm#Pairs[6]http://ace-host.stuart.id.au/russell/files/tc/doc/estimators.txtshorewall(8)
π NOTES π
https://shorewall.org/FAQ.htm#faq18https://shorewall.org/FAQ.htm#faq18- Shorewall FAQ 97a
https://shorewall.org/FAQ.htm#faq97a shorewall-tcclasseshttps://shorewall.org/manpages/shorewall-tcclasses.htmlshorewall-manglehttps://shorewall.org/manpages/shorewall-mangle.htmlhttps://shorewall.org/traffic_shaping.htmhttps://shorewall.org/traffic_shaping.htmhttps://shorewall.org/configuration_file_basics.htm#Pairshttps://shorewall.org/configuration_file_basics.htm#Pairs
and that's the whole page bestie, you ate that π β¨
Configuration Files β 09/24/2020 β SHOREWALL-TCDEVICES(5) π¦ go shape some traffic, icon π«Άπ
π¦ 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