Skip to content

Instantly share code, notes, and snippets.

@bbqsrc
Created June 17, 2014 12:42
Show Gist options
  • Save bbqsrc/1dcfb422fee286232ac1 to your computer and use it in GitHub Desktop.
Save bbqsrc/1dcfb422fee286232ac1 to your computer and use it in GitHub Desktop.
Suggested solution to shape the speed of the Monero daemon
#!/bin/sh
LINK_SPEED="1gbit"
RATE="128kbit"
IFACE="eth0"
PORT="18080"
tc qdisc add dev $IFACE root handle 2 htb default 1
tc class add dev $IFACE parent 2: classid 2:6 htb rate $LINK_SPEED
tc class add dev $IFACE parent 2:6 classid 2:100d htb rate $RATE
tc filter add dev $IFACE parent 2: protocol ip pref 4 u32 match ip sport $PORT 0xffff classid 2:100d
tc filter add dev $IFACE parent 2: protocol ip pref 4 u32 match ip dport $PORT 0xffff classid 2:100d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment