title: Docker traffic control (tc) - specified qdisc not found
body: <p>I am looking for a solution to how to run <code>tc qdisc</code> command in Docker Ubuntu.</p>
  <p>The version of Ubuntu is 20.04 LTS and I run Docker on Windows. Here's part of my <code>docker-compose.yml</code>:</p>
  <pre class="lang-yaml prettyprint-override"><code>fuseki_1:
          image: leroykim/jena-fuseki:ubuntu
          container_name: fuseki_1
          depends_on: 
              - fuseki-data_1
          ports:
              - &quot;3031:3030&quot;
          cap_add:
              - NET_ADMIN
          command: bash -c &quot;apt-get update &amp;&amp; apt-get -y install iproute2&quot;
  fuseki_2:
          image: leroykim/jena-fuseki:ubuntu
          container_name: fuseki_2
          depends_on: 
              - fuseki-data_2
          ports: 
              - &quot;3032:3030&quot;
  fuseki_3:
          image: leroykim/jena-fuseki:ubuntu
          container_name: fuseki_3
          depends_on: 
              - fuseki-data_3
          ports: 
              - &quot;3033:3030&quot;
  </code></pre>
  <p>By this setting, I want to introduce some delays, duplicates, and losses to fuseki_1 and simulate the real-world-like network during federated queries.</p>
  <p>The commands I want to run are like this:</p>
  <pre class="lang-sh prettyprint-override"><code>sudo tc qdisc add dev eth0 root handle 1: prio
  sudo tc qdisc add dev eth0 parent 1:1 handle 2: netem delay 100ms 5ms 25% loss 15.3% 25% duplicate 1% corrupt 0.1% reorder 5% 50%
  </code></pre>
  <p>The problem is that the commands keep throwing the <code>Error: Specified qdisc not found.</code> error.</p>
  <p>I checked the several stack overflow answers and web pages. It seems they run the <code>tc qdisc</code> commands smoothly, but none of them worked for me:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/37350857/manipulating-network-traffic-between-containers-in-docker-in-docker-environment">Manipulating network traffic between containers in Docker in Docker environment without privileged mode?</a></li>
  <li><a href="https://stackoverflow.com/questions/41899906/apply-netem-wan-delay-on-a-docker-container-interface">Apply NetEM WAN delay on a docker container interface</a></li>
  <li><a href="https://stackoverflow.com/questions/40196730/simulate-network-latency-on-specific-port-using-tc">Simulate network latency on specific port using tc</a></li>
  <li><a href="https://medium.com/@kazushi/simulate-high-latency-network-using-docker-containerand-tc-commands-a3e503ea4307" rel="nofollow noreferrer">Simulate high latency network using Docker containers and “tc” commands</a></li>
  <li><a href="https://github.com/moby/moby/issues/33162" rel="nofollow noreferrer">Getting advanced traffic shaping with tc and containers to work #33162</a></li>
  <li><a href="https://stackoverflow.com/questions/64755248/linux-fedora-tc-qdisc-gets-error-specified-qdisc-not-found">Linux fedora tc qdisc gets “Error: Specified qdisc not found.”</a> (could not install the kernel-modules-extra package)</li>
  </ul>
  <p>I really appreciate your help in advance!</p>