LinuxCommandLibrary

tc

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

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)

> TERMINAL_GEAR

Curated for the Linux community

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00