Jump to content


This topic is now archived and is closed to further replies.


deny a range of Ip addresses

Recommended Posts

How do I block more than one range of IP addresses.  And can I do this without a .htaccess file, or can I do it through one of the config files.  I'm running SuSE Linux 10 on the server.

Share this post

Link to post
Share on other sites
There are a number of ways to block ip numbers or ranges of ip numbers. The first one of the top of my hease is the hosts.deny file. usally found in the '/etc' directory of your system.
inside that file you would have something like

ALL:  <-- blocks a single ip number
ALL: <- blocks 255 ip numbers (.0-.255)
ALL: 61.151.  <-- matches the fist two octels (blocks lots of ip starting with 61.151)
ALL: .co.jp <-- blocks everything with with a domain ending with (.co.jp)

another way is to block them within the httpd.conf file using the

Order Deny,Allow
Deny from xxx.xxx.xxx.xxx <--repeat as needed
Deny from xxx.xxx.xxx.xxx      each on a line by its self
Allow from all

last would be using .htaccess

personally, I use all three

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.