Traffic Shaping

From PCLinuxOS Knowledgebase
Jump to navigation Jump to search

YOU ARE HERE :: Main Page >> HowTo >> Traffic Shaping

  • Relevant to ALL editions of PCLinuxOS.

Use Traffic Shaping with tc on Linux

If you want more control over the network traffic, you can use the tc (traffic control) command on the server.

Install the iproute2 package if it’s not already installed. NOTE: It should already be installed in PCLinuxOS.

Use tc to limit the bandwidth

on the specific network interface (e.g., eth0):

Open a konsole window and as the root user, enter the following


sudo tc qdisc add dev eth0 root tbf rate 1mbit burst 32kbit latency 400ms


Adjust the rate parameter to your desired limit.

This approach affects all traffic on the specified interface and gives more granular control over network shaping.

Change the rate Parameter

To change the rate parameter after the tc command has already been run, you’ll first need to delete the existing qdisc (queueing discipline) configuration and then reapply it with the new rate.

Here’s how to do it:

Delete the existing tc rule:

In a konsole window as the root user, enter the following:

sudo tc qdisc del dev eth0 root

Replace eth0 with the network interface you’re using.

Now you can reapply the tc rule with the new rate:

In a konsole window as the root user, enter the following:

sudo tc qdisc add dev eth0 root tbf rate NEW_RATE burst 32kbit latency 400ms

This will replace the old rate with the new one without needing to reboot or restart any services.