Subnet calculator written in Python. It takes IP address and subnet mask as an input and returns for a given subnet network and broadcast address, first and last IP host, wildcard mask and number of usable hosts.
Program takes an IPv4 address and subnet mask as an input and returns following information:
Program will accept IPv4 address from class A, B, C except:
You need Python version 3.6 or later to run the program.
git clone https://github.com/crypt0rr/subnetcalc.git
Note: Subnet mask should be entered in dotted decimal format e.g. 255.255.255.0. Program will accept subnet mask from 255.0.0.0.0 to 255.255.255.255. If you use subnet mask 255.255.255.254 (/31) or 255.255.255.255 (/32) program returns None for: network and broadcast address, first and last IP address, usable hosts per subnet.
python3 subnetcalc.py
$ python3 subnetcalc.py
Enter an IP address: 192.168.0.0
Enter a subnet mask: 255.255.255.0
--------------------------------------------------
CIDR notation: /24 (255.255.255.0)
First usable IP: 192.168.0.1
Last usable IP: 192.168.0.254
Broadcast: 192.168.0.255
Usable hosts: 254
Network: 192.168.0.0
Wildcard mask: 0.0.0.255