Ready to Start Your Career?

Create Free AccountBy: Fabien M.

March 24, 2016

# A Quick Mathematical Formula for Subnetting

March 24, 2016

By: Fabien M.

March 24, 2016

Let's begin.Steps:

A few examples of how to use this table and concept:

- Write powers of 2 left to right
- Write CIDR subnet masks from 1 to 32. This will take 4 lines, one for each octet in the IP addresses
- Write the subnet mask: add powers of 2 from left to current column

2^{x} | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

1st octet | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

2nd | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

3rd | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

4th | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |

mask | 128 | 192 | 224 | 240 | 248 | 252 | 254 | 255 |

*- Find the last usable IP in the subnet 172.16.1.0/30*/30 gives a 4 total IP's (0 to 3), meaning 2 usable IPs (1 and 2), 0 is the subnet and 3 is the broadcast. Answer is 172.16.1.2*- Can 192.168.15.23 use 192.168.16.35 as default gateway if subnet is 255.255.254.0?*254 as a mask gives us 2 IP in the third octet, so:- 192.168.0.x and 192.168.1.x are in the same subnet
- 2.x and 3.x
- 4.x and 5.x
- 6.x and 7.x

*- What is the CIDR subnet mask for /12?*The answer is 255.240.0.0*- What mask do you need to have 64 hosts in a subnet?*64 total IP's won't be enough (don't forget broadcast and subnet IP's remove usable IP's from the total). You need to choose a subnet that can accommodate 126 hosts (128-2) hence a mask of 255.255.255.128, or /25 Thanks and I hope this is helpful to you.