Services: DHCPv6: Leases are not showing.

Started by IsaacFL, August 01, 2023, 06:22:42 AM

Previous topic - Next topic
Updated earlier today, an none of the DHCPv6 leases are showing at Services: DHCPv6: Leases.
It has "No results found!"

I can see in the log that the leases are being issued and the clients are getting their leases renewed.


Just checked and only see static leases. All others are missing as well.

August 01, 2023, 07:22:07 AM #2 Last Edit: August 01, 2023, 08:04:33 AM by svengru
Seeing the following error in the logs:

[8d39241d-14b2-4959-af1a-9bae7ea535bf] Script action failed with Command '/usr/local/opnsense/scripts/dhcp/get_leases6.py --inactive ''' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/actions/script_output.py", line 44, in execute subprocess.check_call(script_command, env=self.config_environment, shell=True, File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/opnsense/scripts/dhcp/get_leases6.py --inactive ''' returned non-zero exit status 1.

Running the script manually gives the following error:

root@mainrouter:/usr/local/opnsense/scripts/dhcp # ./get_leases6.py --inactive INACTIVE
Traceback (most recent call last):
  File "/usr/local/opnsense/scripts/dhcp/./get_leases6.py", line 158, in <module>
    parsed_lease = parse_lease(cur_lease)
  File "/usr/local/opnsense/scripts/dhcp/./get_leases6.py", line 110, in parse_lease
    iaid_duid = parse_iaid_duid(lines[0].split()[1])
  File "/usr/local/opnsense/scripts/dhcp/./get_leases6.py", line 96, in parse_iaid_duid
    'iaid': int(''.join(reversed(parsed[0:4]))),
ValueError: invalid literal for int() with base 10: 'f1f5dd7f'

That error makes sense given the input value.
The code assumes that the value is always integer but the format of an IAID is not specified by the DHCPv6 protocol itself.

The format is governed by isc-dhcpd, which in the legacy codebase was always assumed as a base 16 integer.

Can you try
opnsense-patch 23318015b 4ec97df4c

https://github.com/opnsense/core/commit/23318015b2abc075a3bf506533da07ea740d2250
https://github.com/opnsense/core/commit/4ec97df4c475223b31df31cb61e78f1bdb71d789

Cheers,
Stephan

That patch worked for me. Thanks for the super-fast fix.

I can see the leases now after the patch.

Now, however, the interface column is empty, and the IP Address and the DUID columns are not wide enough to show the actual values. Even on full screen with collapsed side menu.


You can see the leases after the patch, but all of the clients show as "offline" even though they are active. I didn't have this issue with the previous verison.

Quote from: Cljackhammer on August 01, 2023, 06:43:15 PM
You can see the leases after the patch, but all of the clients show as "offline" even though they are active. I didn't have this issue with the previous verison.

Same here.

I see both active and offline clients after appling the patch


Same issue with most clients showing offline.
Debugging this a bit more, I see that all online client have static IPs and no client with a dynamic IP shows online.

Is the interface column showing nothing for you? It is empty on mine.


Dynamic leases are now showing up for me too.  Awesome.

As far as the status goes - and let me preface this by saying this is a WAG (Wild-Ass Guess) - I think it might be an NDP thing.  If you run `ndp -a` you'll see a bunch of stale addresses.  Addresses seem to go stale pretty fast.  Cisco defines stale as: "Previously-known neighbor is no longer reachable. No action is taken to verify its reachability until traffic must be sent."

Once I ping the client from the firewall, the status changes to on-line, and `ndp -a` no longer shows stale.

About 60 seconds later, the address goes stale again.

Looking elsewhere, stale is defined as "Not up to date", not to be confused with INCOMPLETE or FAILED.

In Juniper (JunOS) you can modify the time when an address goes stale, I haven't found that option yet in FreeBSD.

These are just my observations, not my SWAG (scientific wild-ass guess) :)  Maybe the status column is reacting to STALE when it should be reacting to something else... I dunno.

Have same problem after Update. No more DHCPv6 lease showing. But I don't feel very comfortable editing in a Python script when I don't really know what I'm doing.

Similar errors since the update:

Unable to delete DHCPv4 entries, get error on DHCPV4 log (yes, IPv6 Message inside the dhcpv4 log):
Unable to add forward map from FQDN to IPv6-Address timed out

disable the Blocklist inside unbound doesn't help.

RADV not running:
usr/local/sbin/pluginctl: The command '/usr/local/sbin/radvd -p /var/run/radvd.pid -C /var/etc/radvd.conf -m syslog' returned exit code '1', the output was '/var/etc/radvd.conf:16 error: syntax error'

and unable to delete DHCPv4 entries. I can click on delete icon but it don't go away. The screen is refreshing and the entry appears again.