Tuesday, 25 March 2014

Working Out Address IPv4 Ranges using Subnet Mask and Wildcard Mask Math

So this probably is old news to a lot of people but I've just come across it and it's going to save me some long hand mathematics so I'm jotting it down here:

There is a quick and easy way to work out the valid range of addresses for a subnet knowing just the IP address and mask.

First you take the network address and mask (obviously work out the network address first if you do not have the network address) - For example 10.17.32.0/19

Write them down in dotted decimal - 10.17.32.0 255.255.224.0

Subtract the subnet mask from the 'all 255's mask' - 255.255.255.255 - 255.255.224.0 = 0.0.31.255

Add this value to the network address - 10.17.32.0 + 0.0.31.255 = 10.17.63.255

And here you have the valid range of addresses 10.17.32.0 - 10.17.63.255

Excellent!

No comments:

Post a Comment