Created
June 13, 2019 11:40
-
-
Save jdraths/8dd6aabaa9771c09589af9fbc63102a1 to your computer and use it in GitHub Desktop.
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
# install it | |
apt-get install ipset | |
# create a blacklist | |
ipset create blacklist hash:ip hashsize 4096 | |
# add the blacklist to your iptables rules | |
iptables -I INPUT -m set --match-set blacklist src -j DROP | |
iptables -I FORWARD -m set --match-set blacklist src -j DROP | |
# check that rule is set in iptables | |
iptables -L | |
# now add the offending ip address | |
ipset add blacklist WW.XX.YY.ZZ | |
# check that the ip address is in your blacklist | |
ipset list blacklist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment