T Terry Olsen Apr 24, 2006 #1 Is there an "elegant" way to determine if an IP address is on my subnet? Or do I just compare the first 2 or 3 octets?
Is there an "elegant" way to determine if an IP address is on my subnet? Or do I just compare the first 2 or 3 octets?
T Tom Dacon Apr 24, 2006 #2 The elegant way is get both the subnet address and the IP address as 32-bit unsigned integers, and AND them together. If the result equals the subnet, it's on the subnet. HTH, Tom Dacon
The elegant way is get both the subnet address and the IP address as 32-bit unsigned integers, and AND them together. If the result equals the subnet, it's on the subnet. HTH, Tom Dacon