Linux How-To

Easy methods to Calculate IP Subnet Tackle with ipcalc Software

SEOClerks

When managing a community, you’ll undoubtedly must take care of subnetting. Some community directors are capable of do the binary math fairly rapidly of their head, to find out the subnet masks. Nonetheless, others may have some assist and that is the place the ipcalc instrument is useful.

Learn Additionally: A Linux Sysadmin’s Information to Community Administration, Troubleshooting and Debugging

Ipcalc truly does much more – it takes an IP tackle and netmask and offers the ensuing broadcast, community, Cisco wildcard masks, and host vary. You may as well use it as a educating instrument to current subnetting leads to a straightforward to know binary values.

A few of the makes use of of ipcalc are:

Validate IP tackle
Present calculated broadcast tackle
Show hostname decided by way of DNS
Show community tackle or prefix

Easy methods to set up ipcalc in Linux

To put in ipcalc, merely run one of many instructions under, primarily based on the Linux distribution you’re utilizing.

$ sudo apt set up ipcalc

The ipcalc bundle needs to be put in mechanically below CentOS/RHEL/Fedora and it’s a part of the initscripts bundle, but when for some motive it’s lacking, you may set up it through the use of:

# yum set up initscripts #RHEL/CentOS
# dnf set up initscripts #Fedora

Easy methods to Use ipcalc in Linux

Beneath you may see some examples of utilizing ipcalc.

Get details about the community tackle:

# ipcalc 192.168.20.zero

Pattern Output

Tackle: 192.168.20.zero 11000000.10101000.00010100. 00000000
Netmask: 255.255.255.zero = 24 11111111.11111111.11111111. 00000000
Wildcard: zero.zero.zero.255 00000000.00000000.00000000. 11111111
=>
Community: 192.168.20.zero/24 11000000.10101000.00010100. 00000000
HostMin: 192.168.20.1 11000000.10101000.00010100. 00000001
HostMax: 192.168.20.254 11000000.10101000.00010100. 11111110
Broadcast: 192.168.20.255 11000000.10101000.00010100. 11111111
Hosts/Web: 254 Class C, Personal Web

Calculate a subnet for 192.168.20.zero/24.

# ipcalc 192.168.20.zero/24

Pattern Output

Tackle: 192.168.20.zero 11000000.10101000.00010100. 00000000
Netmask: 255.255.255.zero = 24 11111111.11111111.11111111. 00000000
Wildcard: zero.zero.zero.255 00000000.00000000.00000000. 11111111
=>
Community: 192.168.20.zero/24 11000000.10101000.00010100. 00000000
HostMin: 192.168.20.1 11000000.10101000.00010100. 00000001
HostMax: 192.168.20.254 11000000.10101000.00010100. 11111110
Broadcast: 192.168.20.255 11000000.10101000.00010100. 11111111
Hosts/Web: 254 Class C, Personal Web

Calculate a single subnet with 10 hosts:

# ipcalc 192.168.20.zero -s 10

Pattern Output

Tackle: 192.168.20.zero 11000000.10101000.00010100. 00000000
Netmask: 255.255.255.zero = 24 11111111.11111111.11111111. 00000000
Wildcard: zero.zero.zero.255 00000000.00000000.00000000. 11111111
=>
Community: 192.168.20.zero/24 11000000.10101000.00010100. 00000000
HostMin: 192.168.20.1 11000000.10101000.00010100. 00000001
HostMax: 192.168.20.254 11000000.10101000.00010100. 11111110
Broadcast: 192.168.20.255 11000000.10101000.00010100. 11111111
Hosts/Web: 254 Class C, Personal Web

1. Requested dimension: 10 hosts
Netmask: 255.255.255.240 = 28 11111111.11111111.11111111.1111 0000
Community: 192.168.20.zero/28 11000000.10101000.00010100.0000 0000
HostMin: 192.168.20.1 11000000.10101000.00010100.0000 0001
HostMax: 192.168.20.14 11000000.10101000.00010100.0000 1110
Broadcast: 192.168.20.15 11000000.10101000.00010100.0000 1111
Hosts/Web: 14 Class C, Personal Web

Wanted dimension: 16 addresses.
Used community: 192.168.20.zero/28
Unused:
192.168.20.16/28
192.168.20.32/27
192.168.20.64/26
192.168.20.128/25

If you wish to suppress the binary output, you should utilize the -b possibility as proven.

# ipcalc -b 192.168.20.100

Pattern Output

Tackle: 192.168.20.100
Netmask: 255.255.255.zero = 24
Wildcard: zero.zero.zero.255
=>
Community: 192.168.20.zero/24
HostMin: 192.168.20.1
HostMax: 192.168.20.254
Broadcast: 192.168.20.255
Hosts/Web: 254 Class C, Personal Web

To seek out extra in regards to the ipcalc utilization, you should utilize:

# ipcalc –help
# man ipcalc

You will discover the official ipcalc web site at http://jodies.de/ipcalc.

Conclusion

This was a easy tutorial, displaying tips on how to use ipcalc instrument with some primary examples. In case you have any questions or recommendation, be sure that to submit them within the remark part under.

Source link

Related Articles

Leave a Reply

Back to top button