New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dhcp: fix test merge of legacy configuration prefix #7046
Comments
Well, you need a matching WAN DHCPv6 client config first and LAN tracking it. Otherwise you can't use the WAN prefix with the "::" prefix trick and it will be treated as a normal IPv6. |
Ok you did that in step 3 but if DHCP was already running it can't render the correct prefix. |
I restarted both routers multiple times to make sure it assigns everything correctly. I could only see |
Well, does Interface: Overview list your correct WAN prefix? The merge is pretty straight forward if there is a delegated prefix acquired. |
The problem is that it acquired |
Yeah, but it only does that if your prefix failed to acquire. These "dynamic" approaches to static things like DHCP are not really great, but ISPs tend to be on the side of only giving out dynamic IPv6 prefixes so it is what it is. |
I do get The DHCP just doesn't seem to delegate that by itself, even though LAN is set to "track interface" and its address is set to |
/128 .. it should be /64? |
It is, my bad |
Well it's easy to check the DHCPv6 config file to see if subnet6 and range6 have the expected value:
|
Well now that I set the public routing prefix manually, subnet6 looks good, but range6 doesn't exist. Probably because I didn't set a DHCP address range? But when I set only the prefix, subnet6 is
|
that looks good now |
Then my subrouter only gets |
I'm very very sure this is a configuration problem because a number of people would immediately say that this doesn't work (anymore). Does your entered prefix range start exactly with "::" ? You can also try the range to see if it merged. I'd still be surprised if it wouldn't. |
Also your steps don't mention setting "Allow manual adjustment of DHCPv6 and Router Advertisements" which is a prerequisite for even configuring the DHCPv6 on that interface configuration. |
Yes
I'm not sure I understand this
This is enabled, otherwise the daemon wouldn't start, and it wouldn't work when writing the public routing prefix manually. |
Just put a range from |
Yes... but... what's your |
57 bits I get /56 from my ISP so I chose to delegate /60 |
Do you see any log message for this?
|
No, I don't |
Well, I'm a bit lost. The code issue is somewhere here https://github.com/opnsense/core/blob/master/src/etc/inc/plugins.inc.d/dhcpd.inc#L1368-L1388 Just to be sure you have set prefix hint on WAN to /56 ? |
The size is set to 56 (I asked my ISP and it is the right size) but "Send IPv6 prefix hint" is unchecked. |
thanks that should be enough. i checked on my end and it merges fine. I can only recommend trying to emit a few log messages to help me see where it fails. |
merge_ipv6_address seems to be the problem. It converts So when you merge at the end, it tries to merge Why is there If I replace
with
I do get |
Hi, If it helps by bringing more examples, I’m facing the same issue, see https://forum.opnsense.org/index.php?topic=37348.0 opnsense-log | grep "not a valid prefix" returns nothing either. |
@fichtner if my LAN IPv6 Prefix ID is |
The help text is indeed incorrect, you need to omit the trailing zeroes. For 15x /60, simply enter |
Writing without the trailing zeroes works indeed.
|
I've always used it that way, probably never paid attention to the help text. Not sure if it ever worked with trailing zeroes. |
This doesn't make sense to me... trailing zeroes are not optional. It would indicate it's lower /64 bit side. The examples are derived from https://tldp.org/HOWTO/Linux+IPv6-HOWTO/ch22s06.html and you can see they have all the trailing zeroes in the config format. Something about leading and trailing zeroes is weird, maybe an intermediate compress destroys the correct ordering making prefix merge fail. I've been away the past two weeks so I haven't looked closer yet. |
The relevant change from 5fa042b almost 18 months ago... it must have broken somewhere else in the meantime. |
This seems to have broken it for me 7fcbb22, 3 months ago, as I found out in #7046 (comment) |
Well, all I can say is that I've never entered trailing zeroes for the PD range values. It seemed the logical syntax to me and always worked as expected. I just checked some of my config backups from as long as four years ago to confirm. dhcpdv6.conf needs the prefix6 values to end with :: of course, but this has always been handled by the OPNsense prefix merge code. Note: This only applies to track6 LAN interfaces. For static LAN interfaces, you have to enter the PD range values "correctly" of course (ending with :: or trailing zeroes). |
#7046 The merge is used as a test if a prefix is set at all (the legacy input required a "prefix" but it was actually a suffix and verified as such) but now that we prevent merging without a leading "::" the final compress moves the compressed format from the front to the end because that sequence is longer but the next merge doesn't like that. Do the test merge without storing the result as we do not need it anyway.
dd92fe4 is worth a try... keep in mind this is only a problem due to allowing people to use the wrong legacy format...
Cheers, |
The patch works with trailing zeroes |
Thanks, I'll add this to 23.7.11 and close. Cheers, |
#7046 The merge is used as a test if a prefix is set at all (the legacy input required a "prefix" but it was actually a suffix and verified as such) but now that we prevent merging without a leading "::" the final compress moves the compressed format from the front to the end because that sequence is longer but the next merge doesn't like that. Do the test merge without storing the result as we do not need it anyway. (cherry picked from commit dd92fe4)
Not for me, I provided details in the forum post. |
@PacoTyson yeah a separate issue with all the details would be good. Already knowing this is not your issue goes back to square one: 50% change for configuration mistake, 50% chance of another bug. Let's start from the top. Cheers, |
#7046 The merge is used as a test if a prefix is set at all (the legacy input required a "prefix" but it was actually a suffix and verified as such) but now that we prevent merging without a leading "::" the final compress moves the compressed format from the front to the end because that sequence is longer but the next merge doesn't like that. Do the test merge without storing the result as we do not need it anyway.
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
Describe the bug
The help in DHCPv6 "Prefix Delegation Range" says:
But this is wrong.
My LAN interface is set to "track interface" and I chose to delegate /60, so I set the range as ::10:0:0:0:0 to ::f0:0:0:0:0, because it says to only enter the range. But this was not working. OPNsense RA is Unmanaged and my subrouter was only requesting a prefix and not an address. It got the prefix (
f
was the first assigned) but its LAN addresses were::f0:xxxx:xxxx:xxxx:xxxx/128
instead of2001:(...)f0:xxxx:xxxx:xxxx:xxxx/128
. I had to set the range with the public routing prefix too for it to work.This also caused the route to be created with
0:0:0:f0/60
instead of2001:(...)f0:xxxx:xxxx:xxxx:xxxx/60
.So either the help is wrong, or the prefix delegation doesn't work as expected.
To Reproduce
Expected behavior
The prefix delegation should delegate the public routing prefix as well as the prefix itself.
Describe alternatives you considered
Add the public routing prefix in the range.
Screenshots
Relevant log files
If applicable, information from log files supporting your claim.
Additional context
Add any other context about the problem here.
Environment
OPNsense 23.7.9-amd64 (virtualized)
Ryzen 5 3600
Linux bridge
The text was updated successfully, but these errors were encountered: