How To Block IP Address using IPTABLES

Tags: January 3, 2014 11:17 PM

Make sure running the iptables command as root. Example below shows how to block traffic coming from IP 1.2.3.4.

# iptables -I INPUT -s 1.2.3.4 -j DROP
Turn on some logging on those rule, we insert it at line two. Assuming the first iptables command was the at line one.
# iptables -I INPUT 2 -s 1.2.3.4 -j LOG --log-prefix "Dropped an As*hole"
References

Share on Facebook Twitter

0 comments:

Post a Comment