[TriLUG] pattern matching in hosts.allow

Cristóbal Palmer cristobalpalmer at gmail.com
Tue Jan 8 10:53:47 EST 2013


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




More information about the TriLUG mailing list