[TriLUG] pattern matching in hosts.allow

Blackburn, Marvin mblackburn at glenraven.com
Tue Jan 8 11:11:15 EST 2013


The subnet calculator was an great idea.  We attacked it in a similar  way.  Since we could use consecutive ip's we were able to generate what we needed.
Another poster had some regex suggestions, but it was unclear exactly what pattern matching was allowed from the man page.
Thanks for the suggestion!

-----Original Message-----
From: trilug-bounces at trilug.org [mailto:trilug-bounces at trilug.org] On Behalf Of Cristóbal Palmer
Sent: Tuesday, January 08, 2013 10:54 AM
To: Triangle Linux Users Group General Discussion
Subject: Re: [TriLUG] pattern matching in hosts.allow

From 'man 5 HOSTS_ACCESS' I get:


       ·      An  expression of the form `n.n.n.n/m.m.m.m´ is interpreted as a `net/mask´ pair. An IPv4 host address is matched if `net´ is equal to the bitwise AND of the
              address and the `mask´. For  example,  the  net/mask  pattern  `131.155.72.0/255.255.254.0´  matches  every  address  in  the  range  `131.155.72.0´  through
              `131.155.73.255´.  `255.255.255.255´ is not a valid mask value, so a single host can be matched just by its IP.


And then I used http://www.subnet-calculator.com/cidr.php with the RFC 1918 address 10.0.0.113 and a "Mask Bits" value of 28, which it tells me is equivalent to a CIDR netmask of 255.255.255.240 and which yielded the range 10.0.0.112 through 10.0.0.127. I suggest you play around with that website and a test host until you have it right for your network.

Cheers!
--  
Cristóbal Palmer
cmpalmer.org

-- 
This message was sent to: Marvin Blackburn <mblackburn at glenraven.com>
To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
Unsubscribe or edit options on the web	: http://www.trilug.org/mailman/options/trilug/mblackburn%40glenraven.com
TriLUG FAQ          : http://www.trilug.org/wiki/Frequently_Asked_Questions


More information about the TriLUG mailing list