Get Free Linux Server Security, Performance & Troubleshooting Tips

How can I calculate IP address on Specific CDIR Subnet Ranges?

How can I calculate IP address on Specific CDIR Subnet Ranges?
4.8 (96.67%) 6 votes

In the web hosting world, the networking and IP stuff are present in the¿ day to day talking for most system administrators and developers. But some of them get confused about IP ranges and how many IPs are available on each CDIR range.

Sometimes we can question ourselves about:

How many ips are in a /24 range?
How many ips are in a /29 range?
How many ips are in a /30 range?




That’s why I’ve creted a simple chart specifying the CDIR range and the number of available IPs on each range.

CDIR Subnet & Available IPs Chart

There are many more ranges than these, but those will never be used by the average developers and sysadmins, only are used by big NOCs on Datacenters.
[table “” not found /]

Calculate CDIR subnet ranges using ipcalc command using Linux

If you need to calculate IP address or subnet on Linux operating system, you can use an IP Netmask calculator. There is a really useful tool called ipcalc, who does all the job for you. With ipcalc you will be able to calculate ipv4 and ipv6 address on each specified CDIR subnet range.

ipcalc does all the hard work for you, it uses and IP address and its netmask, then it calculates the rest of the network details and generates a friendly human readable report which include IP address, Network range, Netmask, Broadcast IP address, type of IP Class, min and max host IP numbers.




Output example:

[user@server.nixcp.com ~]$ ipcalc 192.168.1.1/24
Address:	192.168.1.1
Network:	192.168.1.0/24
Netmask:	255.255.255.0 = 24
Broadcast:	192.168.1.255

Address space:	Private Use
Address class:	Class C
HostMin:	192.168.1.1
HostMax:	192.168.1.254
Hosts/Net:	254

As you see, there are 256 available IPs on a /24 range, but only 254 are usable. And with ipcalc command or our simple CDIR to IP chart, you will be able to find out how many IPs there are on any CDIR subnet range easily, without advanced networking knowledge or making complicated mathematical calculations.

 

Leave a Reply

Your email address will not be published. Required fields are marked *