Skip to content

Instantly share code, notes, and snippets.

@vitalbone
Last active June 17, 2016 06:17
Show Gist options
  • Save vitalbone/e05c2c95efa0bdf0764357ea4329c971 to your computer and use it in GitHub Desktop.
Save vitalbone/e05c2c95efa0bdf0764357ea4329c971 to your computer and use it in GitHub Desktop.
How Subnets work

How subnets work

Each number in the ip address represents binary octets.

00000101 01101000 00000000 00000000
128|64|32|16|8|4|2|1
// these are the same. 32 represents all 4 blocks in the ip
10.119.12.123
10.119.12.123/32
// these are the same. 16 represents half (2) the blocks in the ip
10.119.121.187/16
10.119.121.187/255.255.0.0
11111111 11111111 00000000 00000000
// how 17 would be represented in the ip
10.119.121.187/17
10.119.121.187/255.255.128.0
11111111 11111111 10000000 00000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment