DHCPv6 option 18

Om man kör DHCPv6 och vill få spårbarhet på leasen kan man använda option 18 i utrustningen som saker ansluts till och med en sådan här dhcpd6.conf får ni spårbarhet

option dhcp6.macaddr code 193 = string;
option dhcp6.leased-address code 194 = string;
option dhcp6.macaddr = binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6));
option dhcp6.leased-address = binary-to-ascii(16,16, ":", substring(suffix(option dhcp6.ia-na, 24),0,16));
log (info, concat ("Lease for ",config-option dhcp6.leased-address, " leased to ", config-option dhcp6.macaddr));

subnet6 2001:db8:8000::/33 {
        range6 2001:db8:ffff:1:: 2001:db8:ffff:1::aa;
        default-lease-time 120;
        max-lease-time 120;
        prefix6 2001:db8:8000:: 2001:db8:ffff:: /48;
}

dhcp-loggen

Mar 12 11:57:45 uplink dhcpd: Solicit message from fe80::a00:27ff:fe46:9097 port 546, transaction ID 0xFEFBE100
- Port 5 i switchen med mac ac:f1:df:b4:88:40
Mar 12 11:57:45 uplink dhcpd: remote-id - 0:0:0:ab:1:0:1:0:5:ac:f1:df:b4:88:40
- Mac 08:00:27:46:90:97
Mar 12 11:57:45 uplink dhcpd: client-id - 0:1:0:1:1c:94:19:75:8:0:27:46:90:97
- Prefix 2001:db8:ffff::/48 blev utdelat till port 5 i ac:f1:df:b4:88:40
Mar 12 11:57:45 uplink dhcpd: Picking pool prefix 2001:db8:ffff::/48
Mar 12 11:57:45 uplink dhcpd: remote-id - 0:0:0:ab:1:0:1:0:5:ac:f1:df:b4:88:40
Mar 12 11:57:45 uplink dhcpd: client-id - 0:1:0:1:1c:94:19:75:8:0:27:46:90:97
Mar 12 11:57:45 uplink dhcpd: Advertise PD: address 2001:db8:ffff::/48 to client with duid 00:01:00:01:1c:94:19:75:08:00:27:46:90:97 iaid = 658935959 valid for 60 seconds

Busenkelt! 🙂