Networking – Is 225.225.225.128 a Valid Subnet Mask?

ipip addressnetworkingsubnet

I have been told that we have two devices on a network:

10.40.225.142 and 10.40.225.144

These devices both have

  • Gateway 10.40.225.129

  • Subnet mask 225.225.225.128 (note 225 is Not a typo)

These are communication intermittently with a server 10.40.224.156

So my question is: Is that a valid subnet? I have only ever seen 255 or 0 in the first one – three octets.

Best Answer

Basically a valid subnetmask, when written in binary, has to consist of only consecutive 1's and then 0's, but no intermittent mixing. I.e.:

255.255.255.128 -> 11111111.11111111.11111111.10000000 is valid
255.255.255.0   -> 11111111.11111111.11111111.00000000 is valid
255.255.255.144 -> 11111111.11111111.11111111.10010000 is not valid

Edit: The first bits (the nonzero bits) could also be set to match the network address, the important thing is that if you perform a logical AND operation on an IP with the subnet mask you get the network address.

Host:     10.40.225.164   -> 0000 1010 . 0010 1000 . 1110 0001 . 1010 0100
Subnet M: 255.255.225.128 -> 1111 1111 . 1111 1111 . 1110 0001 . 1000 0000
Network:  10.40.225.128   -> 0000 1010 . 0010 1000 . 1110 0001 . 1000 0000
Related Question