• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

tc Command Examples in Linux

by Deepika

The tc command is a powerful tool for manipulating and displaying network traffic control settings on Linux systems. With tc, you can set up rules and policies to control network traffic flows, prioritize certain types of traffic, and shape or limit the bandwidth available to specific network interfaces or applications.

Here are some common use cases for the tc command:

  • Traffic shaping: By using tc, you can control the rate of data transfer for specific network interfaces, so that certain types of traffic (such as VoIP or video streaming) receive higher priority and more bandwidth than other types of traffic. This can help improve the quality and responsiveness of real-time applications.
  • Bandwidth limiting: tc allows you to limit the amount of bandwidth available to specific applications or network interfaces, which can be useful for preventing network congestion and ensuring that critical applications have enough bandwidth to function properly.
  • Quality of Service (QoS): With tc, you can assign different types of traffic to different classes or queues, and then apply different rules or policies to each queue. This can help ensure that critical traffic (such as VoIP or video conferencing) receives higher priority and better quality of service than other types of traffic.
  • Network emulation: tc can also be used to simulate network conditions, such as latency, jitter, and packet loss, which can be useful for testing and troubleshooting network applications.

tc Command Examples

1. Add constant network delay to outbound packages:

# tc qdisc add dev eth0 root netem delay delay_in_millisecondsms

2. Add normal distributed network delay to outbound packages:

# tc qdisc add dev eth0 root netem delay mean_delay_msms delay_std_msms

3. Add package corruption/loss/duplication to a portion of packages:

# tc qdisc add dev eth0 root netem corruption|loss|duplication effect_percentage%

4. Limit bandwidth, burst rate and max latency:

# tc qdisc add dev eth0 root tbf rate max_bandwith_mbmbit burst max_burst_rate_kbkbit latency 
max_latency_before_drop_msms

5. Show active traffic control policies:

# tc qdisc show dev eth0

6. Delete all traffic control rules:

# tc qdisc del dev eth0

7. Change traffic control rule:

# tc qdisc change dev eth0 root netem policy policy_parameters

Summary

The tc command can be a bit complex to use, as it requires a good understanding of networking concepts and terminology. However, there are many resources available online to help you get started, such as the man page (man tc) and the Linux Advanced Routing & Traffic Control HOWTO.

Filed Under: Linux

Some more articles you might also be interested in …

  1. espeak: Uses text-to-speech to speak through the default sound device
  2. protonvpn-cli connect Command Examples
  3. gh secret set: Create or update GitHub secrets from the command line
  4. tomb Command Examples in Linux
  5. “aws s3 ls” Command Examples
  6. fnm: Fast Node.js version manager
  7. eqn: Equation preprocessor for the groff (GNU Troff) document formatting system
  8. pacaur Command Examples in Linux
  9. yum: command not found
  10. logstash Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright