Skip to content

Instantly share code, notes, and snippets.

@nij4t
Last active August 10, 2020 13:12
Show Gist options
  • Save nij4t/54aab473add21aac1ee48c707d9c5480 to your computer and use it in GitHub Desktop.
Save nij4t/54aab473add21aac1ee48c707d9c5480 to your computer and use it in GitHub Desktop.
Ingress Traffic Throttling
########## downlink #############
# slow downloads down to somewhat less than the real speed to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#
# attach ingress policer:
/sbin/tc qdisc add dev $DEV handle ffff: ingress
# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:
/sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment