I am looking for a solution to how to run tc qdisc command in Docker Ubuntu.
The version of Ubuntu is 20.04 LTS and I run Docker on Windows. Here's part of my docker-compose.yml:
fuseki_1:
        image: leroykim/jena-fuseki:ubuntu
        container_name: fuseki_1
        depends_on: 
            - fuseki-data_1
        ports:
            - "3031:3030"
        cap_add:
            - NET_ADMIN
        command: bash -c "apt-get update && apt-get -y install iproute2"
fuseki_2:
        image: leroykim/jena-fuseki:ubuntu
        container_name: fuseki_2
        depends_on: 
            - fuseki-data_2
        ports: 
            - "3032:3030"
fuseki_3:
        image: leroykim/jena-fuseki:ubuntu
        container_name: fuseki_3
        depends_on: 
            - fuseki-data_3
        ports: 
            - "3033:3030"
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.
The commands I want to run are like this:
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%
The problem is that the commands keep throwing the Error: Specified qdisc not found. error.
I checked the several stack overflow answers and web pages. It seems they run the tc qdisc commands smoothly, but none of them worked for me:
- Manipulating network traffic between containers in Docker in Docker environment without privileged mode?
 - Apply NetEM WAN delay on a docker container interface
 - Simulate network latency on specific port using tc
 - Simulate high latency network using Docker containers and “tc” commands
 - Getting advanced traffic shaping with tc and containers to work #33162
 - Linux fedora tc qdisc gets “Error: Specified qdisc not found.” (could not install the kernel-modules-extra package)
 
I really appreciate your help in advance!
