-2

Disclaimer: Basic to no knowledge here and I'm not sure I'm going to be able to get my question across here but here goes anyway.

I understand in /24 subnet you will have (as an example) 10.0.0.1 to 10.0.0.254 . (I have basic awareness of why .0 and .255 are not included as usable ip addresses)

So questions is how does the ip range work in /31 subnets?

I assume that they would pair consecutively ie 10.0.0.0/31 would be on the same subnet as 10.0.0.1/31?

And say 10.0.0.10/31 and 10.0.0.100/31 would not be on the subnet. But again, just an assumption without knowledge.

Any guidance would be appreciated.

Duncan
  • 31
  • 6

1 Answers1

0

Simply put, your assumptions are correct. All addresses in the same subnet are consecutive, with the range defined by the network ID and the subnet mask.

Your basic awareness is probably good enough: the first address (10.0.0.0) is the network ID, and the last (10.0.0.255) is the broadcast address.

It is worth noting that a /31 would be a very useless subnet that you would never actually see in the wild. The entire network would consist of two addresses, with the first being the network ID, and the second being the broadcast address. In other words, there's no addressable room for any actual hosts. The smallest usable network is a /30 network, which gives room for the network ID, two hosts, and then broadcast. I remember asking my ISP for static addresses once upon a time, and I was given a /30 network to use as I pleased, which to me meant my server and my desktop PC could be public facing and online at the same time.

Jarmund
  • 3,003
  • 4
  • 22
  • 45
  • 1
    Thank you. The explanation of the subnet consisting network ID and broadcast address only, helped me not to look at it as just two ip addresses. The application is for a WireGuard connection so only two addresses needed. (again please excuse my terminology, probably incorrect) – Duncan Sep 01 '22 at 20:43
  • Well, anything with that format is an IP address, you just need to keep track of whether it's an IP address available for use, or if it's reserved for ID or broadcast. ***Fun fact:*** It's perfectly fine to have an IP address ending in `.0`. If you use a subnet mask of `/23` or lower, the network will have one or more of these `.0` addresses available for hosts, but I have noticed some network firmwares not liking them, so it's probably best to avoid using them. – Jarmund Sep 01 '22 at 20:46