Skip to content

Instantly share code, notes, and snippets.

@Integralist
Last active April 1, 2016 17:38
Show Gist options
  • Save Integralist/cff468ba808fbca09602 to your computer and use it in GitHub Desktop.
Save Integralist/cff468ba808fbca09602 to your computer and use it in GitHub Desktop.
Networking CIDR explained

The table at the bottom of this gist was copied from: http://software77.net/cidr-101.html

10.0.0.0 is a 32 bit number split into four 8 bit groups (8, 16, 24, 32)

Note: 1 byte == 8 bits (so 10 representing a single byte)

Where n (below) is given the value 8, 16, 24, or 32

10.0.0.0/n

8 states the first 8 bits is accounted for (by the 10 we've specified).
Meaning the rest can be added up to their max of 255 (10.255.255.255)

16 states the first 16 bits is accounted for (by the 10.0 we've specified).
Meaning the rest can be added up to their max of 255 (10.0.255.255)

24 states the first 24 bits is accounted for (by the 10.0.0 we've specified).
Meaning the rest can be added up to their max of 255 (10.0.0.255)

32 states the first 32 bits is accounted for (by the 10.0.0.0 we've specified).
Meaning the rest can be added up to their max of 255 (10.0.0.0)

Example: 10.0.0.1

IP10001
8 Bit Blocks8 bits [24-31]8 bits [16-23]8 bits [08-15]8 bits [00-07]
Bit # 3130292827262524232221201918171615141312111009080706050403020100
Decimal 1286432 168421128643216842112864321684211286432168421
Binary00001010000000000000000000000001

Notice the binary row marks 1 for the decimal numbers that add up to the specified byte
e.g. if you want 254 then you have 1 in all of the binary columns (under decimal) except the 1 at the end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment