Skip to content

Instantly share code, notes, and snippets.

@smhuda
Created July 3, 2023 15:37
Show Gist options
  • Save smhuda/7b514f4e3f703099ebf2b5dff4e67af0 to your computer and use it in GitHub Desktop.
Save smhuda/7b514f4e3f703099ebf2b5dff4e67af0 to your computer and use it in GitHub Desktop.
Convert CIDRs to an IP address list
# pip3 install netaddr
from netaddr import IPNetwork
with open("scope.txt", "r") as file:
for x in file:
for a in IPNetwork(x):
print('%s' % a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment