Created
July 3, 2023 15:37
-
-
Save smhuda/7b514f4e3f703099ebf2b5dff4e67af0 to your computer and use it in GitHub Desktop.
Convert CIDRs to an IP address list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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