[Python] Convert CIDR into IP Range

A simple python script converts a Classless Inter-Domain Routing (CIDR)-formatted IP address into an IP range and netmask without using any third-party packages.


let’s see an example:

$ python subnet.py 200.100.33.65/26
Address:    200.100.33.65
Netmask:    255.255.255.192
Network:    200.100.33.64
Broadcast:  200.100.33.127

Well, that’s my take on it, anyway. What do you guys think ?

Advertisements

Tagged: , , , , ,

Leave a Reply :

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: