4.3. Display traffic control configurations (tcshow
command)¶
tcshow
is a command to display the current traffic control settings for network interface(s).
4.3.1. tcshow
command help¶
usage: tcshow [-h] [-V] [--tc-command | --tc-script] [--debug | --quiet] [--debug-query] [--stacktrace] [--ipv6] [--docker] [--color] [--export EXPORT_PATH] [--exclude-filter-id] [--dump-db DUMP_DB_PATH]
device [device ...]
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--tc-command display tc commands to be executed and exit. these commands are not actually executed.
--tc-script generate a shell script file that describes tc commands. this tc script execution results are nearly equivalent to the tcconfig command. the script can be executed without tcconfig package
installation.
--debug for debug print.
--quiet suppress execution log messages.
--color colorize the output. require Pygments package.
--export EXPORT_PATH [experimental]
--exclude-filter-id [experimental] not display filter_id.
--dump-db DUMP_DB_PATH
[experimental] dump parsed results to a SQLite database file
Debug:
--debug-query for debug print.
--stacktrace print stack trace for debugging information. --debug option is required to see the debug print.
Traffic Control:
device network device name (e.g. eth0)
--ipv6 Display IPv6 shaping rules. Defaults to show IPv4 shaping rules.
Docker:
--docker apply traffic control to a docker container. to use this option, you will need to specify a container id as 'device' as follows: tcset --container <container id>
Documentation: https://tcconfig.rtfd.io/
Issue tracker: https://github.com/thombashi/tcconfig/issues
4.3.1.1. Example¶
# tcset eth0 --delay 10ms --delay-distro 2 --loss 0.01% --rate 0.25Mbps --network 192.168.0.10 --port 8080
# tcset eth0 --delay 1ms --loss 0.02% --rate 500Kbps --direction incoming
# tcshow eth0
{
"eth0": {
"outgoing": {
"dst-network=192.168.0.10/32, dst-port=8080, protocol=ip": {
"filter_id": "800::800",
"delay": "10.0ms",
"delay-distro": "2.0ms",
"loss": "0.01%",
"rate": "250Kbps"
}
},
"incoming": {
"protocol=ip": {
"filter_id": "800::800",
"delay": "1.0ms",
"loss": "0.02%",
"rate": "500Kbps"
}
}
}
}
Note
Scope of tcshow
command is limited to parameters that can be set with tcset
(i.e. tcshow
is not a general purpose tool to display all of the parameters of the tc command).
Note
tcshow
may output improper values when using tbf
.