[Techtalk] iptables to block a single host...

James jas at spamcop.net
Thu Apr 8 23:51:18 EST 2004


On Thu, 08 Apr 2004 16:23:27 -0400, Walt <pippin at freeshell.org> wrote:

> I have a particular host harassing my server, but
> they're on a DSL connection with a fairly frequently
> changing IP. So, I was going to try to block them
> based on their domain information using this command:
>
> /sbin/iptables -A INPUT -p TCP -s *.balt.east.verizon.net -d 0/0 -j DROP
>
> but it says host/network 'balt...net' not found
>
> How can I modify this...?
> Can I even do what I'm aiming to?

IPtables works with IP addresses, not names - so if you give it a
regular hostname, it turns that into the IP address and uses that.
Give it a wildcard, and it'll be confused, just as if you tried
something like "ping *.balt.east.verizon.net".

If you can work out the range of IP addresses you want to block,
then doing what you want is easy. What kind of abuse is it,
by the way? If it's something like 'unwanted' access to a WWW site,
Apache *CAN* block users by hostname rather than IP, as you're trying
to do with IPtables...


James.


More information about the Techtalk mailing list