Just threw together a quick and dirty PHP-based subnet calculator. What sets this one apart from others is that it works with both IPv4 and IPv6 inputs and has subnet splitting capability.
Use the first field to enter a network to get details about. The format is CIDR notation ‘220.127.116.11/22’.
Use the second field to split the first network into smaller networks. The notation is ‘/24’. The network must be smaller than the 1st one obviously. Click any of the smaller subnets to show details.
Source code is on github:
4 Responses to PHP IPv4 and IPv6 Network and Subnet Calculator
Please, no, PLEASE, share src of this AWESOME calc.
No any chance?
This is exactly what I need. Could you please share the source code? Please !!!
Major shoutout for this script. It is really helpful. Tnx a million!
I am implementing this script in a subnet testenvironment for Cisco students and it is working fabulous. I am having a hard time figuring out how to modify the script in order to get n-th subnet. My tool generates a random IP + CIDR and asks for exeample ‘what is the BC of the 3th subnet, given 18.104.22.168/14’
For classful addressess I feed the question to the php class containing the script on this site as arguments and it returns an array with the answers. Now I have the n-th subnet value ready to feed to the script as an argument, but still struggling to make the answer calculation. To clarify; I still need the full set of calculations (BC, Network address, hostmin and hostmax), but this time for the n-th subnet. Can anyone plz point me in the right direction?