This page looks best with JavaScript enabled

tcconfig

 ·  🎃 kr0m

tcconfig is a really useful tool in test environments to simulate certain scenarios in which the network fails in some way, this will allow us to know how our website behaves under certain circumstances and thus locate possible bugs.

We install the tool from pip:

pip install tcconfig

We can apply certain restrictions on traffic such as maximum transfer rate, delays, packet loss, and we can also apply it only to the traffic of a certain network or service:

tcset –device eth0 –rate 100k
tcset –device eth0 –delay 100
tcset –device eth0 –loss 0.1 -> 0.1%
tcset –device eth0 –rate 100k –delay 100 –loss 0.1
tcset –device eth0 –delay 100 –network 192.168.0.10
tcset –device eth0 –delay 100 –network 192.168.0.0/24 –port 80

To remove the previous config or check the current one:

tcdel –device eth0
tcshow –device eth0

We can see it in action in this animated gif:

If you liked the article, you can treat me to a RedBull here