A subnetting calculator. Calculates network, first host, last host, and broadcast addresses. Prints all that and more.
- IP Address: the IP Address you provided
- Network Address: the Network Address of the IP Address you provided
- First Host: The first host in the subnet (dotted-decimal IP Address format)
- Last Host: The last host in the subnet (dotted-decimal IP Address format)
- Broadcast Address: the network broadcast address (dotted-decimal IP Address format)
- Total Hosts: the total number of hosts on the subnet, including broadcast and network addresses
- Usable Hosts: the available hosts. Total number of hosts minus the broadcast and network addresses
- Subnet ID: the identity or index of the subnet
- Subnet Mask Slash Notation: the subnet mask in slash notation
- Subnet Mask: the subnet mask in dotted-decimal format
- Binary Subnet Mask: the subnet mask converted to binary
- IP Class: the class of the IP Address, ranging from A to C
TABLE Displays:
- Subnet index given network address and subnet mask
- Network address of subnet
- Usable range of valid IP Addresses separated by a dash
- Broadcast Address
After retrieving the file "calc.py", run using the script name in a command prompt, providing an IP-Address in dotted-decimal format and a slash notation subnet mask.
Be aware that a table of all possible subnets given the network address and subnet mask prints. If your given subnet mask is /26, and your ip address is class A (/8 default subnet mask) the table will be huge. 2^18 huge.
Examples:
$ python ./calc.py 192.168.2.1 25
$ python ./calc.py 191.168.2.1 25