Andrew Latham

Ban and Unban Bash aliases to add to system profile or bashrc that will ban, unban and list source addresses to drop with IPTABLES.

alias ban='iptables -I INPUT -j DROP -s'
alias unban='iptables -D INPUT -j DROP -s'
alias banlist='iptables -L | grep DROP'

Usage would be

# ban 123.123.123.123
# banlist
DROP       all  --  123.123.123.123      anywhere
# unban 123.123.123.123
# banlist
# echo "yeah IP Ban is removed"