Shape bandwidth, inject latency and inspect per-flow network behavior from the command line. 20.06.2026 | reading time: 3 min On Linux the `tc` command puts you in control of packets on an interface; shape, delay, drop and measure traffic from the shell. Use it when you need to limit bandwidth for a VM, emulate WAN delay for an application, or collect queueing statistics during troubleshooting. Limit Bandwidth Quickly Example: limit eth0 to 1 Mbit with a token bucket filter; replace the interface name before running. ```bash sudo tc qdisc add dev eth0 root tbf rate 1mbit burst 32kbit limit 30000 sudo tc -s qdisc show dev eth0 ``` Sample output: ``` qdisc tbf 1: root refcnt 2 rate 1Mbit burst 32Kb lat 20.0ms Sent 12345 bytes 120 pkts backlog 0b 0p requeues 0 ``` Remove the rule when done: ```bash sudo tc qdisc del dev eth0 root ``` Network Emulation and Filters Beyond simple shaping you can inject latency, jitter and loss with the netem qdisc, build hierarchical classes with HTB to allocate bandwidth by service, or police ingress traffic; combine tc filters with packet marks from a firewall to target flows precisely, and use an IFB device to shape ingress when necessary. Operational Tips Always test on a spare interface or inside a network namespace first. Use `tc -s qdisc` and `tc -s class` to read counters, prefer classful qdiscs for fine-grained control, and remember that tc requires root privileges and the appropriate kernel modules; extensive shaping can add CPU overhead on high-speed links. Complementary Tools tc is part of the iproute2 family and works best with helpers: mark flows with iptables or nftables, inspect sockets with ss, and use ip to manage addresses and namespaces; monitoring tools and traffic generators make experiments repeatable and visible. Next Steps Start small, measure often, and combine tc with firewall marks and namespaces to build predictable networks; mastering these patterns improves troubleshooting and performance tuning. Consider deepening Linux networking skills and preparing for certifications such as CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. network utilities troubleshooting scripting