Project

General

Profile

Actions

Bug #2511

closed

DHCPv6 Shows Wrong DUID

Added by Phil Lavin over 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DHCP (IPv6)
Target version:
Start date:
06/21/2012
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.1
Affected Architecture:

Description

The DHCPv6 server is issuing leases. It has issued 2a02:b90:7004:4000::8710 to a Windows 7 PC and displays the DUID as 00:01:00:01:13:3e:df:a4:ba:db:03:7f:ba. I have used this to add a static mapping. This static mapping failed to work. Having run wireshark on the Windows PC and looked at the Solicit, the DUID it actually sends is 00:01:00:01:13:3e:df:3b:a4:ba:db:03:7f:ba. You'll see the one pfsense displays is missing a single "3b" before the MAC address. Changing the mapping manually to use the DUID from Wireshark causes it to issue the mapped address correctly.

There are 11 mappings in total, 3 of them have this issue. One is the above mentioned Windows 7 PC and the other 2 are Ubuntu PCs. Other Windows 7 PCs on the network work correctly. I don't have the correct DUIDs of the 2 Ubuntu PCs but I can obtain these if it'd be of any use.


Files

dhcpd.leases (13.1 KB) dhcpd.leases Phil Lavin, 06/22/2012 03:47 AM
dhcpd6.leases (13.7 KB) dhcpd6.leases Phil Lavin, 06/22/2012 08:52 AM
dhcpd6.leases~ (430 Bytes) dhcpd6.leases~ Jeroen van der Wal, 06/19/2013 08:20 AM
Actions #1

Updated by Seth Mos over 9 years ago

ok, wow, I think those DUID values we show are straight from the dhcp leases file. Could be a bug in dhcpd.
Needs more research.

Actions #2

Updated by Phil Lavin over 9 years ago

Where is this file? I'll check the DUIDs in it.

Actions #3

Updated by Jim Pingle over 9 years ago

It's in /var/dhcp/var/db/dhcpd6.leases - but it's encoded.

It's possible there is a buglet in the parsing code, DHCP's encoding of that field is not something I am fond of at all.

It works for me on my Windows 7 box though, I added the DUID from the leases view and it does pick up and use that IP.

Actions #4

Updated by Phil Lavin over 9 years ago

Here's the file, if it helps. As above, DUID Windows reports is:

00-01-00-01-13-3E-DF-3B-A4-BA-DB-03-7F-BA

DUID pfsense reports is:

00:01:00:01:13:3e:df:a4:ba:db:03:7f:ba

IP it gets is:

2a02:b90:7004:4000::8710

IP it's configured to get (using the DUID pfsense reports) is:

2a02:b90:7004:4000::102

Actions #5

Updated by Phil Lavin over 9 years ago

Sorry, that's the wrong file. Right one attached.

Phil

Actions #6

Updated by Phil Lavin over 9 years ago

Got bored at work... don't tell the boss. Found the issue.

The awk clean pattern in status_dhcpv6_leases.php removes semi colons - gsub(";", "")

The encoded DUID has a semi colon in it - \333\272\244\016\000\001\000\001\023>\337;\244\272\333\003\177\272

Running the real DUID through parse_duid() works so I think this is the only issue. I assume someone removed semi colons for a valid reason?

Actions #7

Updated by Phil Lavin over 9 years ago

Having thought about it a little more, it's probably to strip the ; from the end of the lines. Suggested fix is to add a $ to make gsub(";$", "")

Phil

Actions #8

Updated by Jim Pingle over 9 years ago

Did you make and test that change? Did that make it show the proper DUID for you?

Actions #9

Updated by Phil Lavin over 9 years ago

It does. Also had a look around and nothing appears broken as a result. To clarify, line 152ish of status_dhcpv6_leases.php changed to:

$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";$\", \"\"); print;}'";

Shouldn't need to escape the newly added $ unless you want to do so for clarity that it's not part of a variable.

Actions #10

Updated by Jim Pingle over 9 years ago

I tried it on mine as well with a somewhat lengthy dhcpv6.leases file and it appears to have parsed everything OK still.

I committed the change, it should show up here momentarily.

Actions #11

Updated by Jim Pingle over 9 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #12

Updated by Jim Pingle over 9 years ago

  • Status changed from Feedback to Resolved
Actions #13

Updated by Jeroen van der Wal over 8 years ago

I seem to have a similar problem.

A windows 8 client with the DUID 00:01:00:01:18:1c:59:c5:00:25:22:92:f5:43 (verified with wireshark) displays as 0f:00:01:00:01:18:1c:59:c5:00:25:22:22:92:f5:43 on the web interface.
It adds 0f at the start and 22 in the middle.

Actions

Also available in: Atom PDF