Below is a short script designed to output the addressable IP addresses within a given subnet.
Note : This script requires the netaddr python library.
from netaddr import IPNetwork
IPADDRESS = raw_input('Enter Subnet:')
for ip in IPNetwork(IPADDRESS).iter_hosts():
print '%s' % ip
print "Usage: ",sys.argv,"[SUBNET ID]/[NETMASK]"
print "Output addressable ip addresses within a given subnet."
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
Want to become a programming expert?
Here is our hand-picked selection of the best courses you can find online:
Python Zero to Hero course
Python Pro Bootcamp
Bash Scripting and Shell Programming course
Automate with Shell Scripting course
The Complete Web Development Bootcamp course
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial