Re: finding netmask for "arbitrary" ip addressby Plankton (Vicar)
|on Nov 29, 2011 at 06:12 UTC||Need Help??|
I am not sure I understand the problem you are trying to solve, but if you just want to figure out if a given ip address is within a subnet it is easier if you convert the ip address, and network addresses and broadcast addresses from a quad 4 representation to an integer. Then do something like this ...
I used ipcalc to work out the network address and broadcast address and script I wrote, quad2int.pl, to convert those IP to integer.