- Find client:
cat /run/dhcpdv6.leases
- Get
ia-na
value.
If not starting with \000\000\000
, slicing required.
Python script to turn DUID into needed format:
import binascii
# Replace the string below with your IA_NA data
ia_na_data = "\000\002\000\..."
# Convert the binary data to a hexadecimal string
hex_duid = binascii.hexlify(ia_na_data)
print(hex_duid)
Python script to slice IAID from DUID and convert to DUID format:
import binascii
# Replace the string below with your IA_NA data
ia_na_data = b"\266\"\017\353\000\002\000\..."
# Convert the binary data to a hexadecimal string
hex_data = binascii.hexlify(ia_na_data)
# IAID is the first 4 bytes (8 hex characters)
iaid = hex_data[:8]
# DUID is the rest
duid = hex_data[8:]
print("IAID:", iaid.decode())
print("DUID:", duid.decode())
Then, to create a static mapping:
set service dhcpv6-server shared-network-name SOMENAME subnet 2a0c:xxxx::/64 static-mapping SOMETHING identifier 00:02:00...
set service dhcpv6-server shared-network-name SOMENAME subnet 2a0c:xxxx::/64 static-mapping SOMETHING ipv6-address 2a0c:xxx::...