Bug #2511
closed
Added by Phil Lavin over 12 years ago.
Updated over 11 years ago.
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
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.
Where is this file? I'll check the DUIDs in it.
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.
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
Sorry, that's the wrong file. Right one attached.
Phil
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?
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
Did you make and test that change? Did that make it show the proper DUID for you?
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.
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.
- Status changed from New to Feedback
- % Done changed from 0 to 100
- Status changed from Feedback to Resolved
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.
Also available in: Atom
PDF