This function will take an IP address and either a subnet mask, or a mask length, and return a custom object with information about that subnet. The information you get is basic stuff like network address, the first and the last usable addresses, the broadcast address etc. But it will also tell you the class of the address, as well as if it’s a private address or not. If run without any parameters it will try to get the needed information from the host you are running it on.

As always, if you discover any bugs, or have any ideas for future improvement, drop me a line in the comments section below!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s