Skip to content
Related Articles

Related Articles

Improve Article

How to Calculate IP Subnet Address with ipcalc Tool ?

  • Last Updated : 30 May, 2021

Subnetting is something you’ll have to deal with if you’re doing any kind of moderate to advanced networking. While some people can do the binary math in their heads to figure out the correct subnet-mask, others may find it difficult to calculate. For those people, Ipcalc is a Linux utility that may assist them to compute the number of subnets, the subnetting mask, and other IP addressing-related information.

Ipcalc determines the broadcast, network, Cisco wildcard mask, and host range from an IP address and netmask. You can create subnets and supernets by specifying a second netmask. It’s also meant to be a teaching tool. Therefore, the subnetting results are presented as simple binary values.

Ipcalc features:

  • Formats for multiple addresses and netmask output (dotted quad, hex, number of bits).
  • Broadcast address, network class, Cisco wildcard, hosts/range, and network range are all output.
  • Bitmaps of various types are output.
  • A user-defined number of extra networks are output.
  • Multiple networks can be accessed using the command line.
  • Hostname DNS resolutions.


To install Ipcalc in Ubuntu/Debian-based Linux, open terminal and run the following command:

$ sudo apt-get install ipcalc

How to use Ipcalc?

Use ipcalc to find out everything you need to know about your IP address:

$ ipcalc

Calculate a subnet

To calculate subnet for use the following command: 

$ ipcalc

Calculate a single subnet with 5 hosts

To calculate a single subnet, use the following command: 

$ ipcalc -s 5

Calculate multiple subnets using a single command

Assume you want to split into three subnets, with a total of 50 hosts. In each segment, specify your network mask and the number of hosts.

$ ipcalc -s 10 20 20

My Personal Notes arrow_drop_up
Recommended Articles
Page :