Skip to content

Instantly share code, notes, and snippets.

@ehsahil
Created December 20, 2018 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehsahil/912a37a9a1b4d3c2e52ef75dea408c94 to your computer and use it in GitHub Desktop.
Save ehsahil/912a37a9a1b4d3c2e52ef75dea408c94 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
import sys
from netaddr import IPNetwork
if __name__ == "__main__":
if len(sys.argv) != 2:
print "Usage: %s <CIDR Block>\n" % sys.argv[0]
else:
for ip in IPNetwork(sys.argv[1]):
print '%s' % ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment