Bug #2511
closedDHCPv6 Shows Wrong DUID
100%
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
Updated by Seth Mos over 12 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.
Updated by Phil Lavin over 12 years ago
Where is this file? I'll check the DUIDs in it.
Updated by Jim Pingle over 12 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.
Updated by Phil Lavin over 12 years ago
- File dhcpd.leases dhcpd.leases added
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
Updated by Phil Lavin over 12 years ago
- File dhcpd6.leases dhcpd6.leases added
Sorry, that's the wrong file. Right one attached.
Phil
Updated by Phil Lavin over 12 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?
Updated by Phil Lavin over 12 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
Updated by Jim Pingle over 12 years ago
Did you make and test that change? Did that make it show the proper DUID for you?
Updated by Phil Lavin over 12 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.
Updated by Jim Pingle over 12 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.
Updated by Jim Pingle over 12 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 0f03ae0fb50ff10e2e41566ee04ce974c05b2670.
Updated by Jim Pingle about 12 years ago
- Status changed from Feedback to Resolved
Updated by Jeroen van der Wal over 11 years ago
- File dhcpd6.leases~ dhcpd6.leases~ added
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.