Stupid Computer Tricks: ipcalc

Not having written much on here lately, I wanted to start a new series titled “Stupid Computer Tricks” – just little hints, tips, tricks that I’ve used over the years that might be helpful to other folks, or others early on in their careers. These aren’t designed to be in-depth how-to’s, just quick reads that introduce a utility, tool, or shortcut that I use on a semi-regular basis.

With that, the first one here is “ipcalc” – a simple command line IP subnetting calculator. If you’re studying for any of the Cisco certs, use this utility to solidify your knowledge, but make sure you know how to figure it out manually too.

With that, install ipcalc (Mac/Linux) and you’re ready to go. By default, ipcalc colorizes the output, which you can turn off with “-n”. You can also suppress the output of the binary info with “-b”.

Examples

How many hosts are in the subnet 192.168.0.0/22 ?

Subnetting: HOW DOES IT WORK?!?

My ISP gave me a /29 address space. What is the usable host range?

What size subnet do I need for 13 hosts?

So there you have it…a simple command line IP subnet calculator. Use it for good, not evil.