set-networking 470 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # cd into the directory containing this script (from the bash faq 028)
  3. if [[ $BASH_SOURCE = */* ]]; then
  4. cd -- "${BASH_SOURCE%/*}/" || exit
  5. fi
  6. latency=30ms
  7. bw=100mbit
  8. if [ "$1" != "" ]; then
  9. latency="$1"
  10. fi
  11. if [ "$2" != "" ]; then
  12. bw="$2"
  13. fi
  14. ./unset-networking
  15. docker exec --privileged floram_p0 tc qdisc add dev eth0 root netem delay $latency rate $bw
  16. docker exec --privileged floram_p1 tc qdisc add dev eth0 root netem delay $latency rate $bw