[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Syntax (IP blocking) hosts.deny..?
- Subject: Re: [cobalt-users] Syntax (IP blocking) hosts.deny..?
- From: flash22@xxxxxxx
- Date: Thu Mar 1 16:17:12 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
On Thu, 1 Mar 2001, Craig Napier wrote:
> Is it possilbe to enter a range of IP's in the hosts.deny file without
> writing each one on a sepearate line? For example if I wanted to block via
> hosts.deny all IP's between
>
> xxx.6.95.0 - xxx.6.95.255
>
> how would I enter that?
There are nice examples in the man page;)
For ranges that are conveniently on octet boundries, all you need to do is
specify the beginning with a trailing dot
eg
ALL: xxx.6.95.
will block all services for all address from xxx.6.95.0 - xxx.6.95.255
ALL: xxx.6. will block all 65536 addresses from xxx.8.0.0 to
xxx.6.255.255 etc
For address ranges that aren't conveniently in nice multiples you have to
use a netmask...
This does the same thing , albiet messier
ALL: xxx.6.95.0/255.255.255.0
To match 512 addresses , remove 1 bit
/255.255.254.0
(your address isn't aligned on 512 boundry tho, so you would need 2 lines
to map 512 addresses in any case [eg 95 is odd])
beware typos in this file, you can kill yourself -)
gsh
(There are earlier posts about this with links to programs to help figure
out netmask/range values )