1

I am trying to use tc to emulate network conditions inside docker containers. My linux is an ubuntu 20.04 LTS inside WSL2.

For this, I am running the container with

docker run -it --cap-add=NET_ADMIN ubuntu:latest

Then inside the docker running

apt-get update
apt-get install linux-generics # for kernel-modules-extra
apt-get install iproute2
tc qdisc add dev eth0 root handle 1: prio

But the last command prints Error: Specified qdisc not found even though tc qdisc show prints

qdisc noqueue 0: dev lo root refcnt 2 
qdisc noqueue 0: dev eth0 root refcnt 2 

There have been many issues opened regarding this question, most of them either refer to compiling a custom kernel (not a viable option for me), installing kernel-modules-extra (which I have done) or just not solving the issue/it solving itself.

N. Rak
  • 132
  • 2
  • 12
  • Docker manages the container network environment on its own, and it might not be the right tool for what you're trying to do. Especially if you need to change kernel parameters, a container does not have an isolated kernel and can't install kernel modules. – David Maze Dec 21 '22 at 11:21
  • Thank you for your prompt response @DavidMaze! If so, is there any method you could recommend that would reach the same result as what i am interested in? – N. Rak Dec 22 '22 at 12:07

0 Answers0