homepage Welcome to WebmasterWorld Guest from 54.145.183.169
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Blocking ip ranges in hosts.allow
how to properly code the ip range for deny
joethejoe

5+ Year Member



 
Msg#: 3175193 posted 7:31 pm on Dec 1, 2006 (gmt 0)

If I wanted to block receiving of mail from the range 71.80.0.0 - 71.95.255.255 how would I do it?
smtp :?: deny

 

Mathieu Bonnet

5+ Year Member



 
Msg#: 3175193 posted 5:17 pm on Dec 21, 2006 (gmt 0)

>
> If I wanted to block receiving of mail from the
> range 71.80.0.0 - 71.95.255.255 how would I do it?
> smtp :?: deny
>

Check `man hosts.deny`, in the "PATTERNS" secction (well, it's the same man page as "hosts.allow").

To block a range of IP addresses, you have to use networks and netmasks.

To designate IPs from 71.80.0.0 to 71.95.255.255, the network is 71.80.0.0, and the netmask is 255.240.0.0.

So you will have to use: `smtp : 71.80.0.0/71.240.0.0`, in your "/etc/hosts.deny" file.

If you want/need more informations about networks/netmasks, I don't have ultimate links, but you might try [en.wikipedia.org...] and the links given at the bottom of the article...

[edited by: Mathieu_Bonnet at 5:17 pm (utc) on Dec. 21, 2006]

Mathieu Bonnet

5+ Year Member



 
Msg#: 3175193 posted 1:45 pm on Dec 22, 2006 (gmt 0)

(Cannot edit my post anymore...)

It's `smtp : 71.80.0.0/255.240.0.0`, not `smtp : 71.80.0.0/71.240.0.0`.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved