pizzashack.org - home of pizzacode

pipcalc homepage

about pizzashack.org
home
history
 
projects
rssh
netutils
mutt patches
pipcalc
admedit
 
contact
contact Info
 

Introduction

pipcalc is the pizzacode IP calculator, a typical IP calculator. It's called pipcalc mainly because there are already a plethora of ipcalc programs out there, and many systems already have one. It's intended to work exactly like Red Hat's IP calculator for compatibility reasons, but additionally has a nice summary if no options are provided. There's really not much else that needs to be said... It's done, no longer under development, and available for download below.

If you're still reading, maybe it's because you want to see some sample output. We can do that:


	$ pipcalc -v 172.16.1.9/27
	hostname:           archonis.sophic.org
	address:            172.16.1.9
	network mask:       255.255.255.224
	broadcast address:  172.16.1.31
	network address:    172.16.1.0
	base class:         class B
	prefix:             /27
	usable hosts/net:   30
		

The -v option just adds the hostname to the output, via your system's configured host resolution mechanism. Without it you get the same output, sans hostname, saving a potential network time-out upon looking up the IP address. You could specify the netmask instead of CIDR notation, if you like. And if you prefer, we can also have our output Red Hat style (suitable for setting variables in init scripts):


	$ pipcalc -b -h -m -n -p 172.16.1.9
	HOSTNAME=archonis.sophic.org
	NETMASK=255.255.0.0
	BROADCAST=172.16.255.255
	NETWORK=172.16.0.0
	PREFIX=16
		

Note that unlike the Red Hat version, all that stuff still prints even though we didn't specify a netmask or prefix with our IP address. Red Hat's ipcalc just gives you an error. Sigh... Never could figure out why it should be required. Those things have standard defaults originating from the original class-based networks.

Get it here: