-
-
Save xanderificnl/80b6a464bf2dca34ccad2fa564e346ab to your computer and use it in GitHub Desktop.
Revisions
-
xanderificnl revised this gist
Sep 26, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ from random import seed, getrandbits from ipaddress import IPv6Network, IPv6Address subnet = u'2a02:58:143:e00::/56' seed() network = IPv6Network(subnet) -
wido revised this gist
Apr 28, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,10 +6,10 @@ from random import seed, getrandbits from ipaddress import IPv6Network, IPv6Address subnet = '2001:db8:100::/64' seed() network = IPv6Network(subnet) address = IPv6Address(network.network_address + getrandbits(network.max_prefixlen - network.prefixlen)) print(address) -
wido created this gist
Apr 28, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/env python3 """ Generate a random IPv6 address for a specified subnet """ from random import seed, getrandbits from ipaddress import IPv6Network, IPv6Address subnet = '2a00:f10:500:40::/64' seed() network = IPv6Network(subnet) address = IPv6Address(network.network_address + getrandbits(128 - network.prefixlen)) print(address)