1

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?

1

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

References:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.