TcConfig —— TC 命令封装器
TcConfig 是个简单的 TC 命令封装器,可以很容易在网络接口设置网络宽带/延迟/丢包等传输控制。
网络接口设置的参数:
1. Network bandwidth [G/M/K bps]
2. Network latency [milliseconds]
3. Packet loss rate [%]
安装:sudo pip install tcconfig
使用
tcset help
usage: tcset [-h] [--version] [--logging] [--stacktrace] [--debug | --quiet]
--device DEVICE [--rate RATE] [--delay DELAY] [--loss LOSS]
[--overwrite]
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--debug for debug print.
--quiet suppress output of execution log message.
Miscellaneous:
--logging output execution log to a file (tcset.log).
--stacktrace display stack trace when an error occurred.
Traffic Control:
--device DEVICE network device name
--rate RATE network bandwidth [K|M|G bps]
--delay DELAY round trip network delay [ms] (default=0)
--loss LOSS round trip packet loss rate [%] (default=0)
--overwrite overwrite existing setting
tcdel help
usage: tcdel [-h] [--version] [--logging] [--stacktrace] [--debug | --quiet]
--device DEVICE
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--debug for debug print.
--quiet suppress output of execution log message.
Miscellaneous:
--logging output execution log to a file (tcset.log).
--stacktrace display stack trace when an error occurred.
Traffic Control:
--device DEVICE network device name
TcConfig 遵循 MIT 开源授权协议。
GitHub 地址:https://github.com/thombashi/tcconfig