Created
February 25, 2013 15:12
-
-
Save compor/5030459 to your computer and use it in GitHub Desktop.
limit rate pings with iptables
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
| iptables -A INPUT -p icmp -m limit --limit 39.6/m --limit-burst 1 -j DROP | |
| # it will cause 2 out of 3 icmp replies to fail when executing a ping like | |
| # ping -c 3 -i 1 -w 3 10.10.10.10 | |
| # | |
| # we needed 1 out of 3 successful ping replies in, so that's 2/3 ~= 0.67 replies per second | |
| # since we cannot use less than 0 values, we up the scale to the minute, so | |
| # 0.67 * 60 = 39.6 replies in 1 minute :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment