Tech Blog

Block and IP Address with iptables

Posted At : January 20, 2011 10:44 AM 1 Comments

I had a nasty hacker trying to get access to one of my Asterisk machines tonight so a quick reminder for myself on how to block a single IP address using iptables:

Block an IP:

iptables -I INPUT -s 111.222.333.444 -j DROP

Unblock an IP (if you typed the wrong address)

#substitute -D for -I
iptables -D INPUT -s 111.222.333.444 -j DROP

Show current rules:

iptables -n -L

Thanks to good folks at www.pbxer.com for the details on this:Asterisk Security: Use iptables to Block the Bad Guys

1 Comments

Admin 1/21/11 12:37 PM