IPv6 log remote-id

Nicholas Thompson Nicholas.Thompson at brandenburgtel.com
Wed Nov 7 19:26:10 UTC 2018


Thanks you for getting me looking in the right direction again, we did not have to do binary-to-ascii.  What I did have to do it get just the last 10 bytes that are the string the first 4 are the enterprise id and is in binary.  That was not the case in v4

Here is what I have now:
    log(info, (concat("Customer: ", suffix(v6relay(1, option dhcp6.remote-id), 10),
        " | IP Address: ", binary-to-ascii(16, 16, ":", suffix(option dhcp6.ia-pd, 16)),
        "/", binary-to-ascii(10, 8, ":", substring(suffix(option dhcp6.ia-pd, 17), 0, 1)),
        " | MacID: ", binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6)),
        " | Interface ID ",
        v6relay(1, option dhcp6.interface-id) 
    )));

And it outputs a log like
Customer: 10001XXXXX | IP Address: 2604:b400:1e25:3d00:0:0:0:0/56 | MacID: 0:23:6a:e:e2:bd | Interface ID JK-1 eth 3/1/5

-----Original Message-----
From: Nicholas Thompson 
Sent: Wednesday, November 07, 2018 7:40 AM
To: 'dhcp-users at lists.isc.org' <dhcp-users at lists.isc.org>
Subject: IPv6 log remote-id


I am having issues logging remote-id in IPv6.  I can see in the packet capture that option 37 does have the proper information.  

However when I attempt to log it I get blank string and the lines after it don't process either.


Here is what I have

log(info, 
      concat("IP Address: ",
        binary-to-ascii(16, 16, ":", suffix(option dhcp6.ia-pd, 16)),
        "/",
        binary-to-ascii(10, 8, ":", substring(suffix(option dhcp6.ia-pd, 17), 0, 1)),
        " | Subscriber:", 
        v6relay(1, option dhcp6.remote-id),
        " | MacID: ",
        binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6))
      )
    );

Here is the log result: 
IP Address: 2604:b400:1e59:b400:0:0:0:0/56 | Subscriber:

If I take out the subscriber section:
log(info, 
      concat("IP Address: ",
        binary-to-ascii(16, 16, ":", suffix(option dhcp6.ia-pd, 16)),
        "/",
        binary-to-ascii(10, 8, ":", substring(suffix(option dhcp6.ia-pd, 17), 0, 1)),
      " | MacID: ",
        binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6))
      )
    );

Here is the log result:
IP Address: 2604:b400:1e92:6700:0:0:0:0/56 | MacID: 0:23:6a:9:8e:2e

We have the same logging format working with IPv4 and option82 not sure why I can't log option 37 in v6

Thank you in advance for any help you can provide.


More information about the dhcp-users mailing list