Forrest logo
back to the tc tool

tc:tldr:fc158

tc: Add package corruption/loss/duplication to a portion of packages.
$ tc qdisc add dev ${eth0} root netem ${select} ${effect_percentage}%
try on your machine

This command is used to add a traffic control queuing discipline (qdisc) to a network device (${eth0}). The "qdisc" is a component of the Linux networking stack that governs the behavior of network traffic.

In this command, the "add" keyword is used to create a new qdisc for the specified network device. The "dev ${eth0}" parameter indicates the network device to which the qdisc will be applied. The ${eth0} is a variable that represents the network interface name, such as eth0 or ens33.

The "root" keyword signifies that the qdisc will be added at the root level, meaning it will control the entire network device.

The "netem" parameter indicates the specific type of qdisc being added. "netem" is a queuing discipline that enables network emulation and introduces various network effects like delay, packet loss, corruption, duplication, etc.

The ${select} variable represents the specific network effect that will be applied by the qdisc. It could be a specific network impairment like delay or loss.

The ${effect_percentage} variable represents the percentage of the network effect to be applied. For example, if delay is selected as ${select}, and ${effect_percentage} is set to 10, it means that the qdisc will introduce a 10% delay in the network traffic.

Overall, this command is used to add a network emulation queuing discipline to a specific network device, allowing the introduction of specific network effects with a desired percentage.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the tc tool