Skip to content

Instantly share code, notes, and snippets.

@buchgr
Created October 23, 2017 17:46
Show Gist options
  • Save buchgr/723ccdf69479366b24cb66f7d83a8872 to your computer and use it in GitHub Desktop.
Save buchgr/723ccdf69479366b24cb66f7d83a8872 to your computer and use it in GitHub Desktop.
foo.sh
# Remove all traffic shaping from eth0
sudo tc qdisc del dev eth0 root
# Add a priority traffic shaping class to the root of eth0
sudo tc qdisc add dev eth0 root handle 1: prio
# Add a qdisc (queuing discipline) with the appropriate traffic shaping to the new traffic shaping class
sudo tc qdisc add dev eth0 parent 1:1 handle 2: netem delay 25ms rate 1gbit
# Add a filter which only selects the qdisc for outgoing packets to 192.168.59.38 (i.e. Boundary Frontend)
sudo tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.59.38 flowid 2:1
@buchgr
Copy link
Author

buchgr commented Oct 23, 2017

# Remove all traffic shaping from eth0
sudo tc qdisc del dev eth0 root
# Add a priority traffic shaping class to the root of eth0
sudo tc qdisc add dev eth0 root handle 1: prio
# Add a qdisc (queuing discipline) with the appropriate traffic shaping to the new traffic shaping class
sudo tc qdisc add dev eth0 parent 1:1 handle 2: netem delay 25ms rate 1gbit
# Add a filter which only selects the qdisc for outgoing packets to 192.168.59.38 (i.e. Boundary Frontend)
sudo tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.59.38 flowid 2:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment