chaosblade icon indicating copy to clipboard operation
chaosblade copied to clipboard

Do I need to be a root user in order to run chaosblade network delay or network loss?

Open JohnMatty opened this issue 2 years ago • 1 comments

Issue Description

Type: bug report , feature request or question Question: Do I need to be a 'root user' in order to run chaosblade network delay or network loss? Question: Should chaosblade only be installed under root? Can i install under any other folder

I have installed tc in my linux

Describe what happened (or what feature you want)

I have installed tc in my linux server. however, when i run a network delay command, i get this error I have the blade installed under /chaosblade folder instead of /root folder.

Error message below : /bin/sh -c /chaosblade/chaosblade-1.3.0/bin/chaos_tcnetwork --start --type delay --interface eth0 --time 500 --offset 10 --debug=false --local-port 3000: cmd exec failed, err: /bin/sh -c tc qdisc add dev eth0 parent 1:4 handle 40: netem delay 500ms 10ms && \ tc filter add dev eth0 parent 1: prio 4 protocol ip u32 match ip sport 3000 0xffff flowid 1:4: cmd exec failed, err: Error: Specified qdisc not found. exit status 2 exit status 1

Describe what you expected to happen

I have installed tc in my linux server. The blade should work from any folder where it is installed, if i have sudo root access . However, i get the error above.

How to reproduce it (as minimally and precisely as possible)

  1. Described above

Tell us your environment

Linux

Anything else we need to know?

JohnMatty avatar May 24 '22 19:05 JohnMatty

The magic of injecting network latency is based on netem, which is a kernel module.

You can run grep '^CONFIG_NET_\(SCH_\|CLS\)' /boot/config-$(uname -r) to see if your machine has this module loaded.

A possible workaround: https://blog.51cto.com/u_14036245/4311881

Super-long avatar May 26 '22 10:05 Super-long