18 lines
393 B
Python
18 lines
393 B
Python
|
#import random
|
||
|
#from ipaddress import IPv6Network, IPv6Address
|
||
|
|
||
|
#ip_a = IPv6Network('2001:db8::/48') + random.getrandbits
|
||
|
#ip_n = IPv6Network(ip_a)
|
||
|
#ip_n.prefixlen = 64
|
||
|
|
||
|
#print (ip_a)
|
||
|
#print (ip_n)
|
||
|
|
||
|
from ipaddress import IPv6Network
|
||
|
import random
|
||
|
|
||
|
ula = IPv6Network("fd00::/8")
|
||
|
random_network = IPv6Network((
|
||
|
ula.network_address + (random.getrandbits(64 - ula.prefixlen) << 64 ),
|
||
|
64))
|