Skip to content

Instantly share code, notes, and snippets.

@tomcarlson
Last active December 24, 2015 14:08
Show Gist options
  • Select an option

  • Save tomcarlson/6809952 to your computer and use it in GitHub Desktop.

Select an option

Save tomcarlson/6809952 to your computer and use it in GitHub Desktop.
.bashrc functions for banning and unbanning ip addresses
# 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