This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if test "$1" = "stop"; then | |
tc qdisc del dev eth0 ingress | |
tc qdisc del dev ifb0 root | |
ip link set dev ifb0 down | |
else | |
modprobe ifb | |
ip link set dev ifb0 up | |
tc qdisc add dev eth0 ingress | |
tc filter add dev eth0 parent ffff: protocol ip u32 match ip src 63.209.0.73 flowid 1:1 action mirred egress redirect dev ifb0 | |
tc qdisc add dev ifb0 root netem delay 200ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
rate_limit2.py | |
Copyright 2014, Josiah Carlson - [email protected] | |
Released under the MIT license | |
This module intends to show how to perform standard and sliding-window rate | |
limits as a companion to the two articles posted on Binpress entitled | |
"Introduction to rate limiting with Redis", parts 1 and 2: |