Bug #6717
closedStatus / DHCPv6 Leases Issues
100%
Description
I'm running 2.3.3.a.20160815.2144 with PR 3102/1, 3102/2, 3103, 3105, 3106 and 3107, testing the fix for https://redmine.pfsense.org/issues/5993. I'm testing on a windows 2012R2 hyper-v server using a private virtual switch and 4 x windows 10 virtual clients. The WAN connection is a bridged modem port shared by another pfsense.
I've noted several issues with Status / DHCPv6 Leases.
1. Upon booting, the message "No leases file found. Is the DHCPv6 server active?" is displayed when Status / DHCPv6 Leases is selected. This is being caused by /var/dhcpd/var/db/dhcpd6.leases being purged upon reboot. DHCPv4 leases are not being purged.
2. /var/dhcpd/var/db/dhcpd6.leases is not being updated consistently. I'm forcing creation of new leases by disable / enable of the network adapter on the PCs, verifying the new lease time using ipconfig /all. I'm noticing that dhcpv6 leases are randomly not updating on Status / DHCPv6 Leases. It occurs approximately 25-50% of the time. If I leave the system alone, when the lease expires, Status / DHCPv6 Leases usually updates correctly. DHCPv4 leases update consistently.
3. When the DHCP Service is stopped, /usr/local/sbin/dhcpleases6 stays running. When the service is restarted, /usr/local/sbin/dhcpleases6 gets killed and restarted along with dhcpd and dhcpd -6. Not really a big deal, but is there a reason it's left running or should it be killed along with dhcpd and dhcpd -6?
4. This is a feature request. It's possible to restart and stop DHCP Service using Status / Dashboard / Services Status. It's possible to restart and stop DHCPv4 by itself using Status / DHCP Leases. There is no way to stop or restart DHCPv6 by itself. It would be useful to be able to restart and stop DHCPv6 by itself.
Updated by Daryl Morse almost 8 years ago
Daryl Morse wrote:
I'm running 2.3.3.a.20160815.2144 with PR 3102/1, 3102/2, 3103, 3105, 3106 and 3107, testing the fix for https://redmine.pfsense.org/issues/5993. I'm testing on a windows 2012R2 hyper-v server using a private virtual switch and 4 x windows 10 virtual clients. The WAN connection is a bridged modem port shared by another pfsense.
I've noted several issues with Status / DHCPv6 Leases.
1. Upon booting, the message "No leases file found. Is the DHCPv6 server active?" is displayed when Status / DHCPv6 Leases is selected. This is being caused by /var/dhcpd/var/db/dhcpd6.leases being purged upon reboot. DHCPv4 leases are not being purged.
2. /var/dhcpd/var/db/dhcpd6.leases is not being updated consistently. I'm forcing creation of new leases by disable / enable of the network adapter on the PCs, verifying the new lease time using ipconfig /all. I'm noticing that dhcpv6 leases are randomly not updating on Status / DHCPv6 Leases. It occurs approximately 25-50% of the time. If I leave the system alone, when the lease expires, Status / DHCPv6 Leases usually updates correctly. DHCPv4 leases update consistently.
3. When the DHCP Service is stopped, /usr/local/sbin/dhcpleases6 stays running. When the service is restarted, /usr/local/sbin/dhcpleases6 gets killed and restarted along with dhcpd and dhcpd -6. Not really a big deal, but is there a reason it's left running or should it be killed along with dhcpd and dhcpd -6?
4. This is a feature request. It's possible to restart and stop DHCP Service using Status / Dashboard / Services Status. It's possible to restart and stop DHCPv4 by itself using Status / DHCP Leases. There is no way to stop or restart DHCPv6 by itself. It would be useful to be able to restart and stop DHCPv6 by itself.
Updating this issue based on 2.4 development snapshot.
1. This item is unchanged. When pfsense is rebooted, dhcp(4) leases are preserved, but dhcp6 leases are purged. Shouldn't the behavior be the same for both?
2. This item is unchanged. (Although I'm testing using windows 10 clients and there is a bug in the most recent version that breaks lease renewals.)
3. This item may be irrelevant. Now both dhcpleases and dhcpleases6 stay running. This is more consistent, but if these processes are considered to be part of dhcp, shouldn't they be started and stopped along with the other dhcp related processes?
4. This item is unchanged. It would be useful and more consistent if it was possible to restart dhcp(4) and dhcp6 separately.
Updated by Phillip Davis almost 8 years ago
As part of removing nanobsd support, it was noticed that dhcp6 leases were not being restored on systems with use_mfs_tmpvar set (i.e. full installs that chose to have /var and /tmp as RAM disks). The code to check for use_mfs_tmpvar was added by: https://github.com/pfsense/pfsense/commit/42ebf952de6a085d17b0850830a8524ad396d1a7
If you are using use_mfs_tmpvar, then this might fix item 1.
Updated by Daryl Morse almost 8 years ago
Phillip Davis wrote:
As part of removing nanobsd support, it was noticed that dhcp6 leases were not being restored on systems with use_mfs_tmpvar set (i.e. full installs that chose to have /var and /tmp as RAM disks). The code to check for use_mfs_tmpvar was added by: https://github.com/pfsense/pfsense/commit/42ebf952de6a085d17b0850830a8524ad396d1a7
If you are using use_mfs_tmpvar, then this might fix item 1.
I'm not using RAM disks so this doesn't appear to be related.
Updated by Daryl Morse almost 8 years ago
With regards to item 1, testing with one windows 10 client and no active leases, Status / DHCPv6 Leases reports "No leases file found. Is the DHCPv6 server active?" However, Diagnostics / Edit File /var/dhcpd/var/db/dhcpd6.leases has the following contents:
# The format of this file is documented in the dhcpd.leases(5) manual page. # This lease file was written by isc-dhcp-4.3.4 # authoring-byte-order entry is generated, DO NOT DELETE authoring-byte-order little-endian; server-duid "\000\001\000\001\037\221Vq\000\025]\\\342\014"; server-duid "\000\001\000\001\037\221Vq\000\025]\\\342\014";
Here is the output of ps auxw | grep dh | grep -v grep:
root 5329 0.0 0.1 10496 2288 - Is Mon09 0:00.00 dhclient: hn1 [priv] (dhclient) _dhcp 9844 0.0 0.1 10496 2404 - Ss Mon09 0:00.10 dhclient: hn1 (dhclient) root 10541 0.0 0.1 8340 2228 - Is Mon09 0:00.00 /usr/local/sbin/dhcp6c -d -c /var/etc/dhcp6c_wan.conf -p /var/run dhcpd 34474 0.0 0.7 22776 13544 - Ss Mon09 0:09.00 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd root 46741 0.0 0.1 8204 2188 - Is 09:15 0:00.01 /usr/local/sbin/dhcpleases -l /var/dhcpd/var/db/dhcpd.leases -d l dhcpd 53782 0.0 0.6 20728 11228 - Ss 09:15 0:01.33 /usr/local/sbin/dhcpd -6 -user dhcpd -group _dhcp -chroot /var/dh root 53996 0.0 0.1 6152 1920 - Is 09:15 0:00.00 /usr/local/sbin/dhcpleases6 -c /usr/local/bin/php-cgi -f /usr/loc root 84818 0.0 0.1 10448 2516 - Ss Mon09 0:35.88 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log -P /var/run/
So it appears there are two separate issues. First, dhcpdv6 appears to be running, but the Status / DHCPv6 is reporting it's not running, possibly because there are no active leases. There should be a distinction between no active leases and not running. Second, /var/dhcpd/var/db/dhcpd6.leases seems to be getting purged upon reboot.
Updated by Phillip Davis almost 8 years ago
https://github.com/pfsense/pfsense/pull/3197
That fixes the little side issue, where in fact the leases file exists but has no leases in it. After the PR, the "no leases file" message only appears if there really is no leases file.
Updated by Daryl Morse almost 8 years ago
I can confirm that this fixes the issue where the file exists but contains no leases. The lease file is still being purged by reboot.
Updated by Renato Botelho almost 8 years ago
- Category set to DHCP (IPv6)
- Status changed from New to Feedback
- Assignee set to Renato Botelho
- Target version set to 2.4.0
- % Done changed from 0 to 100
- Affected Version set to 2.3.2
PR has been merged, thanks!
Updated by Jim Pingle over 7 years ago
- Status changed from Feedback to Resolved
Seems to be fine. No errors on the page with or without leases, with or without RAM disks enabled.
Updated by Daryl Morse over 7 years ago
I'm not able to comment on item 2 in the original list due to a dhcpv6 bug in windows 10, but it appears that the lease file is not being purged by reboot.