how do I setup the blacklist in iptables?
I’m using IPTables in linux as my firewall.. It’s running centos..
I want to setup a blacklist file to block one particular ip that’s showing up and flooding my logs.
in shorewall, there was a blacklist file that when you added ip’s to it, it would basically just ignore those packets. (no log no nothing)..
is there a similar file in iptables?? how would I go about blacklisting them??
Also I notice there’s a $blacklist variable in the iptables.sh file.. what does this refer to?
2 Responses to “how do I setup the blacklist in iptables?”


There is no such option in iptables. only thing you can do is to change your iptable firewall config file with log statments for everything apart from that ip.
drop this ip individually with no logging, and then restrict others with logging.
http://www.linuxquestions.org/hcl/index.php
Report this comment
no…
what you want to do is add this to your firewall config file, or any startup script for that matter:
iptables -A INPUT -s bad_guy_ip -j DROP
iptables -A OUTPUT -s bad_guy_ip -j DROP
this blocks all trafic to it’s ip.
hope it helps.if u want i can make you a script that will let you add such ips to a blacklist
http://www.linuxquestions.org/hcl/index.php
Report this comment