I read that there's another tool for netfilter that allows you to add latency to a ratelimit.
Does anyone have an example of this?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
I use the following script to emulate various network conditions:
#!/bin/bash intf="dev eth0" delay="delay 400ms 100ms 50%" loss="loss random 0%" corrupt="corrupt 0%" duplicate="duplicate 0%" reorder="reorder 0%" rate="rate 512kbit" tc qdisc del $intf root tc qdisc add $intf root netem $delay $loss $corrupt $duplicate $reorder $rate echo "Cancel with:" echo "tc qdisc del $intf root"
In your case, to introduce a 400ms delay and a rate limit of 512kbit/s on outgoing packets on device eth0:
tc qdisc del dev eth0 root tc qdisc add dev eth0 root netem delay 400ms rate 512kbit