Disallow connections from an IP, in one line

Ángel Ortega

If you are having an attack from an IP and want to ban it right now, call this shell function with the offending IP as its only argument:

ban_ip() { iptables -A INPUT -s $1 -j DROP; }