I know I can add latency to an interface using this command:
# tc qdisc add dev eth0 root netem delay 50ms
In addition to latency, I want to limit the bandwidth of this interface to 100kbps.
How can I do this?
I've seen some examples of how to limit the bandwidth. For example:
# tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 10mbit
# tc class add dev eth0 parent 1: classid 1:1 cbq rate 512kbit \
allot 1500 prio 5 bounded isolated
# tc filter add dev eth0 parent 1: protocol ip prio 16 u32
But if I try to run these commands after setting up the latency delay, I get errors that look like this:
RTNETLINK answers: File exists
For example:
# tc qdisc add dev eth0 root netem delay 97ms
# tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 10kbit
RTNETLINK answers: File exists
I really want to be able to do both: Limit the bandwidth AND introduce a latency delay. Does anyone know how to accomplish this?