LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

tc

Linux traffic control and shaping

TLDR

Add constant delay
$ sudo tc qdisc add dev eth0 root netem delay 100ms
copy
Add variable delay
$ sudo tc qdisc add dev eth0 root netem delay 100ms 20ms
copy
Add packet loss
$ sudo tc qdisc add dev eth0 root netem loss 5%
copy
Limit bandwidth
$ sudo tc qdisc add dev eth0 root tbf rate 10mbit burst 32kbit latency 400ms
copy
Show active policies
$ tc qdisc show dev eth0
copy
Delete all rules
$ sudo tc qdisc delete dev eth0
copy
Change rule
$ sudo tc qdisc change dev eth0 root netem delay 50ms
copy

SYNOPSIS

tc [OPTIONS] OBJECT COMMAND

DESCRIPTION

tc (traffic control) configures kernel packet scheduling, shaping, and filtering. It can simulate network conditions like latency, packet loss, and bandwidth limits for testing or quality of service management.

PARAMETERS

qdisc

Queuing discipline - manage packet queuing
add
Add a new traffic control policy
delete
Remove traffic control policy
change
Modify existing policy
show
Display current policies
netem
Network emulation (delay, loss, corruption)
tbf
Token bucket filter (bandwidth limiting)
delay ms
Add latency to packets
loss percent
Drop percentage of packets
rate bandwidth
Maximum bandwidth rate

INSTALL

sudo apt install iproute2
copy
sudo pacman -S iproute2
copy
sudo apk add iproute2-tc
copy
sudo zypper install iproute2
copy
brew install iproute2
copy
nix profile install nixpkgs#iproute2
copy

CAVEATS

Affects outgoing traffic only. For bidirectional control, configure on both ends. Changes are immediate and can disrupt network connectivity. Not persistent across reboots.

HISTORY

tc is part of iproute2, the Linux networking toolkit, providing advanced traffic shaping and network emulation.

SEE ALSO

ip(8), ethtool(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid