Last active
December 24, 2015 14:08
-
-
Save tomcarlson/6809952 to your computer and use it in GitHub Desktop.
.bashrc functions for banning and unbanning ip addresses
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
| # ban/unban, and look at banned ip-address using iptables | |
| ban() | |
| { | |
| sudo iptables -A INPUT -s $1 -j DROP | |
| } | |
| unban() | |
| { | |
| sudo iptables -D INPUT -s $1 -j DROP | |
| } | |
| banned() | |
| { | |
| sudo iptables -L INPUT -v -n | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment