Skip to content

Calculate network address, broadcast address, number of hosts

License

Notifications You must be signed in to change notification settings

weXe1/subnet-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

subnet calculator

Script asks user for:

  • IPv4 address (e. g. 192.168.8.14)
  • subnet mask (e. g. 255.255.255.0 or /24)

and calculates:

  • network address
  • broadcast address
  • number of hosts

usage

$ perl subnetcalc.pl <ipv4 address> <subnet mask>
$ perl subnetcalc.pl <ipv4 address>/<cidr>
$ perl subnetcalc.pl

examples

$ perl subnetcalc.pl 10.0.0.0 255.255.248.0
-------------------------------
Network: 10.0.0.0/21
Broadcast: 10.0.7.255
Mask: 255.255.248.0
Number of hosts: 2046
-------------------------------
$ perl subnetcalc.pl 10.0.0.0/21
-------------------------------
Network: 10.0.0.0/21
Broadcast: 10.0.7.255
Mask: 255.255.248.0
Number of hosts: 2046
-------------------------------
$ perl subnetcalc.pl
IPv4 address: 10.0.0.0
Subnet mask: /21
-------------------------------
Network: 10.0.0.0/21
Broadcast: 10.0.7.255
Mask: 255.255.248.0
Number of hosts: 2046
-------------------------------

About

Calculate network address, broadcast address, number of hosts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages