View Full Version : [kubuntu] blocking clients based on ip address

June 20th, 2008, 09:37 PM
Hi I know there are several ways to do this but I'm looking for the canonical [K]Ubuntu way really.

I'm getting lots of hits from ip addresses in the range and would like to block them as a whole (regardless of whether they're hitting any services).

Should I do this from iptables rules (if so how is their a default way to do this in Ubu') or perhaps from host.deny? Some other way?


June 20th, 2008, 11:06 PM
i'd use iptables... really. But that is, i speak iptables... So there is no reason for me NOT to use it.

the command would be

sudo iptables -s -j DROP
if you have a default of Default Rule of ACCEPT.

also, if you want this to load at bootup, put this line into your /etc/rc.local

/sbin/iptables -s -j DROP

btw, i assume that you meant If this is correct, the subnet mask should be if you need a /8 network.

hope it helps :)