network notes

From Glee
Jump to: navigation, search

Add latency to an interface

/sbin/ifup-local :

if [ "${1}" = "eth0" ]; then
  /sbin/tc qdisc add dev ${1} root handle 1:0 netem delay 1s limit 1000
fi

/sbin/ifdown-local :

if [ "${1}" = "eth0" ]; then
  /sbin/tc qdisc del dev ${1} root handle 1:0 netem delay 1s limit 1000
fi