-2

We're specifying CIDR addresses in AWS rules, and I came across something I don't understand.

/32 means one single address. So 10.0.0.0/32 means only the single address 10.0.0.0. But an address ending in .0 is a broadcast address, right? So in effect, this single address means any address in the range 10.0.0.1 - 10.0.0.255.

/24 means 255 addresses. So 10.0.0.1/24 means any address in the range 10.0.0.1 - 10.0.0.255. ( I don't use 10.0.0.0/24 here because that includes the .0 "expansion" we got above, and I'm trying to contrast with that.)

Are the above statements correct? What is the effective difference between .0/32 and .1/24?


edit

I certainly may be very confused, and I appreciate the attempts to de-confuse me.

My confusion about the .0 address being special in some way stems from my coworker telling me it was so. We set a rule on an AWS cluster to allow connections from 10.0.1.0/32, and it seemingly allowed a connection from 10.0.1.25. Is there another explanation for that?


edit2

Turns out my coworker was very wrong, even in reporting to me which address and subnet he used in the new AWS rule. Sorry for the confusion. If I could delete this question, I would.

pabo
  • 115

2 Answers2

4

You definitely don't have the right grasp of CIDR.

The definition of a broadcast address isn't one that ends in .0. It's an address where all the host bits are set to zero. In a /32, there are no host bits. /32 isn't even a real world network address. It's no doubt being used to indicate that the number written is in fact an IP host address.

3

You've got your networking a little mixed up. An IPv4 ip address where all host bits are set to 0 is a network address. An IPv4 ip address where all host bits are set to 1 is a broadcast address. A .0 or a .255 in an IPv4 host ip address are perfectly valid depending on the subnet mask in use. The confusion comes from too many books, schools and instructors imploring students to "Never use .0 or .255 in a host ip address!" - Because it's easier to just teach that then to teach how and when they are perfectly valid.

joeqwerty
  • 111,849