Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me!!!!how to convert to decimal dotted notation? 1

Status
Not open for further replies.

goku83

Technical User
Apr 16, 2007
1
IT
Hi to everybody, I would want the formula to resolve this problem: I would want to get the address final ip of net: es: I know the first address ip (es. 140.120.80/20) and the total number of addresses of the net (es. 4090 addresses) to get the last address I should convert 4090 in decimal dotted notation and then to add it to the first address.Is there a mathematical operation to do this?if it is so which?thanks!!!
 
Ok, here we go...

Let's take your example 140.120.80/20

Thats 140.120.80.0 mask 255.255.240.0

To calculate the last ip address, the easiest method is to calculate the next consecutive subnet.

I do this by looking at the individual octets of the subnet mask. The third octet is 240, which is 16 less than 256 (total number of possibilities). Therefore the next consecutive subnet is 140.120.96.0 (adding 16 to the third octet).
Now that you know the start of the next subnet, your answer is obviously 1 less than that. So your answer is 140.120.95.255, which is the broadcast ip of that subnet. The last usable ip address is 140.120.95.254

I know you were looking for a specific formula, but this is how I do it. I find it easy to do in my head. But then again, I think my brain works a little differently than others.

MCSE CCNA CCDA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top