OPNsense Forum

English Forums => 23.7 Legacy Series => Topic started by: IsaacFL on August 01, 2023, 06:22:42 am

Title: Services: DHCPv6: Leases are not showing.
Post by: IsaacFL on August 01, 2023, 06:22:42 am
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.

Title: Re: Services: DHCPv6: Leases are not showing.
Post by: svengru on August 01, 2023, 07:13:46 am
Just checked and only see static leases. All others are missing as well.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: svengru on August 01, 2023, 07:22:07 am
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.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: tuto2 on August 01, 2023, 01:32:02 pm
The format is governed by isc-dhcpd, which in the legacy codebase was always assumed as a base 16 integer.

Can you try
Code: [Select]
opnsense-patch 23318015b 4ec97df4c
https://github.com/opnsense/core/commit/23318015b2abc075a3bf506533da07ea740d2250
https://github.com/opnsense/core/commit/4ec97df4c475223b31df31cb61e78f1bdb71d789

Cheers,
Stephan
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: svengru on August 01, 2023, 05:02:02 pm
That patch worked for me. Thanks for the super-fast fix.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: IsaacFL on August 01, 2023, 05:26:44 pm
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.

Title: Re: Services: DHCPv6: Leases are not showing.
Post by: 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.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: IsaacFL on August 01, 2023, 06:58:49 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.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: newsense on August 01, 2023, 06:59:54 pm
I see both active and offline clients after appling the patch
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: Samplex on August 01, 2023, 07:05:29 pm
The patched worked for me.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: svengru on August 01, 2023, 07:06:59 pm
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.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: IsaacFL on August 01, 2023, 07:30:04 pm
Is the interface column showing nothing for you? It is empty on mine.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: svengru on August 01, 2023, 07:55:22 pm
Interfaces do show for me.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: cstevens on August 02, 2023, 05:50:51 am
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.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: open on August 03, 2023, 10:30:13 am
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.

Title: Re: Services: DHCPv6: Leases are not showing.
Post by: svengru on August 03, 2023, 08:18:54 pm
No need to mess with PHP files.

Just run the following via an SSH connection (or serial):

opnsense-patch 23318015b 4ec97df4c
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: rahb on August 03, 2023, 09:23:23 pm
Also having the same issues as others reported with the patches. I see leases now but they are all offline except the static ones.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: franco on August 03, 2023, 09:39:03 pm
We are aware of the display issues, but currently working on improving the axgbe driver. We expect to look into this next week as it seems to be of cosmetic nature.


Cheers,
Franco
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: Cljackhammer on August 03, 2023, 11:46:15 pm
Agree Franco. It is cosmetic. I have no issues IPv6 connectivity on any of my networks.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: tuto2 on August 08, 2023, 01:08:55 pm
Devices showing as offline, missing interfaces and general readability issues should be addressed in:

https://github.com/opnsense/core/commit/a2b9144233df873c24ec3360267499b41bbe6444
https://github.com/opnsense/core/commit/c605175d85b7b6f9a70e9adbb2eedac8f85ba022
https://github.com/opnsense/core/commit/a88fae84f6c670e57545bdce3b752f5c43391b64

If you want to test:

Code: [Select]
# opnsense-patch a2b914423 c605175d8 a88fae84f
Cheers,
Stephan
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: 9axqe on August 24, 2023, 11:15:35 am
I still see the problem in 23.7.2. I'm not able to undertand from github if it's supposed to be included in 23.7.2 or if the patch command is still required?
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: franco on August 24, 2023, 11:16:32 am
No patches required. Can you share a screenshot from 23.7.2?


Cheers,
Franco
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: 9axqe on August 24, 2023, 11:24:30 am
Attached. There a single static lease displayed.

DHCPv6 is running, I have radv set to "assisted" and a virtual IP fd00:1::
Devices on the network are correctly getting all their IPv6 as far as I can tell (ULA, GUA, link local...)
DHCPv6 is using a static range because my ISP does give me a static prefix but has some weird issues whereby I sometime get a /64 only, sometime /62, sometime even /56. Additionally, it allows the GUA to stick even if WAN is down (I'm not entirely confident yet in my fd00:1: ULA addressing and how often some client will decide to switch IP...).
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: franco on August 24, 2023, 11:50:49 am
Can you check if we actually have leases to display?

# cat /var/dhcpd/var/db/dhcpd6.leases


Cheers,
Franco
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: 9axqe on August 24, 2023, 12:16:13 pm
Yes, there are 11 DHCPv6 leases in "binding state active".

iaaddr is within the range I specified for DHCPv6 each time. Do you need more details?
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: franco on August 24, 2023, 12:42:30 pm
If you could share the file that would likely make it easy to spot the issue locally. Send to franco AT opnsense DOT org if you can.


Thanks,
Franco
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: 9axqe on August 24, 2023, 04:24:48 pm
I pasted the entire content in a PM. Let me know if that works.
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: franco on August 24, 2023, 07:03:40 pm
Thanks, we're taking a look.


Cheers,
Franco
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: tuto2 on August 25, 2023, 12:45:27 pm
Can you try

Code: [Select]
# opnsense-patch fb2d2f6
Might've been a spacing issue, but this would require isc-dhcpd to suddenly deviate from the usual format. If this doesn't solve the issue I'll likely need the original file (not a paste) to be able to reproduce it.

Cheers,

Stephan
Title: Re: Services: DHCPv6: Leases are not showing.
Post by: 9axqe on August 25, 2023, 09:38:03 pm
Nice! That worked, I see the DHCPv6 leases now.

Thank you!