In advance or modern networking, you must have knowledge or deal with subnetting. Few of the system administrators or related people can do binary math in their head to calculate the exact subnet mask but some of them need help which is fulfilled by the ipcalc tool in Linux.
In Linux, ipcalc has more abilities in the networking field. Firstly, it collects the data such as IP address and netmask then comes up with the resulting broadcast, network, Cisco wildcard mask, and host range. Also, you can create the subnets and supernets by providing the second netmask. It can be used as the teaching tool by presenting the subnetting results in an easy to understand binary values.
Here, we are going to install ipcalc on Ubuntu 21.04. First open the terminal then run the following command to install the ipcalc tool.
$ sudo apt install ipcalc -y
Now, you can run ipcalc command with your ip address to see all information about the network addresses.
$ ipcalc 192.168.1.67
Output:
To calculate the subnet for 192.168.1.0/24, you can run the following command:
$ ipcalc 192.168.1.0/24
Output:
To calculate a single subnet, you can run the following command:
$ ipcalc 192.168.1.0 -s 7
Output:
To suppress the binary output, you can run the following command by using -b option as shown below:
$ ipcalc -b 192.168.1.0
Output:
If you want to split 192.168.1.0 into three subnets and total hosts are 50. You have to specify the number of hosts and network mast in each segment.
$ ipcalc 192.168.1.0 -s 10 20 20
Output:
To get more details on ipcalc, you can just run the following command:
$ ipcalc --help
Or,
$ man ipcalc
In this article, you learned about the ipcalc tool and the steps to use it with certain examples. It is an important tool for network related tasks. Thank you!
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…
Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…