Skip to content

Instantly share code, notes, and snippets.

@zajdee
Created February 28, 2020 16:36
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 zajdee/cdea59c8e93873159537802fc4d34120 to your computer and use it in GitHub Desktop.
Save zajdee/cdea59c8e93873159537802fc4d34120 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from ipaddress import ip_network
with open('address.list', 'r') as f:
for line in f.readlines():
address = line.strip()
print(ip_network('{}/64'.format(address), strict=False).exploded)
print(ip_network('{}/48'.format(address), strict=False))
print(ip_network('{}/32'.format(address), strict=False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment