If you need an IP subnet calculator that runs under Ubuntu and okay with using the command-line a bit, then I think Sipcalc is one of the best ones out there. But if you’re looking something that is more simpler than ‘Sipcalc’ then you also can try ‘SubnetCalc’.
It is also based on the command-line but really easy to use and other than the subnet calculations, SubnetCalc resolves domain names automatically and shows the binary subnet mask value is in a different color for easy recognition as well.
Some of its features …
*. You can enter either the IP address (supports IP v 4 and 6) or the domain name.
*. Host range.
*. Properties of the IP such as: Its class, private/global value, country of the IP, DNS host (if any) or the local Host name and few others.
You can install SubnetCalc in Ubuntu 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04 Natty Narwhal, 10.10 and 10.04 by using the below command in your Terminal window.
sudo apt-get install subnetcalc
The output is both simple and informative thus you can easily find what you’re looking for.
A simple example …
Let’s say that I wanted to find the subnet mask value of 192.168.1.2 (my local PC’s IP address, replace it with your own IP/network). Then I’d simply enter the below command.
It should give an output similar to the first screenshot above (which of course will differ according to your IP address).
You can also add the “prefix” value in the standard format. For instance …
If you want to use the actual domain name, then use something like the below command.
But as mentioned above, unlike with “Sipcalc” you cannot use multiple address at once. So each has to be executed separately.
For more details please read its manual by using the below command (you might wanna visit this official Subnetcalc home page for more).