47

On a lab to regarding network topology using port scanners, I am instructed "to develop a network inventory and topology for the 123.218.44.0/24 subnet."

What does the notation 0/24 mean there? I had assumed it meant to consider the network range 123.218.44.0 to 123.218.44.24. When I use nmap against a range, using parameters in this format:

nmap -sS -O 123.218.44.0/24

nmap reports that it scanned 256 hosts, presumably 123.218.44.0 to 123.218.44.255. There is only one host between 0 and 24, but there are 4 hosts between 101 and 255. I assume that I am meant to find all 5 of those hosts, but I don't understand the notation so I'm not sure. Can anyone clarify for me?

JoshJordan
  • 12,676
  • 10
  • 53
  • 63
  • 1
    Edit your question to say "I'm trying to write a simple socket-based server and running into trouble understanding how addresses work" and that way it won't get deleted. :) – Daniel Earwicker Apr 01 '09 at 19:32
  • Heh, is it downvoted and nominated for closed due to not being programming related? I don't quite understand. All this work is a precursor to programming in the course, surely it can be understood that this is prerequisite knowledge for sockets programming. No? I am confused. – JoshJordan Apr 01 '09 at 19:35
  • I agree that I really don't see why this was closed down. The question might not be that well phrased, but for me it *is* related to network programming and therefore on-topic on stackoverflow. – Martin C. Apr 01 '09 at 19:36
  • This site is for specific, programming related questions and answers. You're asking a question about a specific network notation. That's not programming related. See Earwicker's comment :) – Jason Coco Apr 01 '09 at 19:37
  • Even without that, the question most definitely is programming related. People are much too close-happly. – Michael Borgwardt Apr 01 '09 at 19:38
  • This is 100% programming related. Voting to reopen – Randolpho Apr 01 '09 at 19:40
  • 1
    More detailed answers can be found on the [Network Engineering Stack Exchange](https://networkengineering.stackexchange.com/questions/3697/the-slash-after-an-ip-address-cidr-notation). – Cagy79 Jun 22 '17 at 07:55

4 Answers4

47

That's Classless Inter-Doman Routing notation. The /24 means that the routing prefix of the subnet is 24 bits long, which means there's ony 8 bits left for the subnet itself, i.e. 123.218.44.0 to 123.218.44.255

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720
  • And is 123.218.44 basically the same as 123.218.44.0/24 when it comes to things like Apache ip location restrictions? – chrismarx Dec 05 '16 at 20:36
  • @chrismarx No. 123.218.44.0/24 would match ips in the range of 123.218.44.0 through 123.218.44.255 – Brig Jun 10 '21 at 17:42
8

/24 means the mask is 255.255.255.0

And the other posters are correct about /24 being CIDR.

dbasnett
  • 11,334
  • 2
  • 25
  • 33
6

The "0/24" is CIDR notation. It's a standard way to represent the subnet mask.

Pesto
  • 23,810
  • 2
  • 71
  • 76
1

/24 represents 255.255.255.0 which is the default subnet mask of Class C ip address which has a number of 16777216 subnets and 254 hosts