No IPv6 delegation on lan interface

already tried but still no ipv6 delegation to lan.

I still think the root cause is this error message:

Sat Aug  3 21:46:09 2024 daemon.warn odhcp6c[30520]: Server returned IA_PD status 'No Address Available (No addresses have been assigned)'

But I don't know where it comes from - my ISP oder my configuration :person_shrugging:

The lack of IPv6 prefix is because of that yes, and it's unlikely to be an error with odhcp6c, unless your ISP is sending multiple/different prefixes between SOLICIT and REQUEST (which appears to be the case).

odhcp6c iterates over DHCPv6 status options sent by the ISP in the reply: https://github.com/openwrt/odhcp6c/blob/master/src/dhcpv6.c#L1142-L1161
If one of the status is not a success, it logs the error, in your case "No Address Available": https://github.com/openwrt/odhcp6c/blob/master/src/dhcpv6.c#L1150-L1154
It then skips the option altogether if one of the status is not a success: https://github.com/openwrt/odhcp6c/blob/master/src/dhcpv6.c#L1163-L1164

This is why it's important for you to try it on with your PC connected directly, as your OS is likely to have a DHCPv6 client that can handle edge cases, where odhcp6c cannot. Then if all is working well, fire Wireshark or similar sniffers and capture the exchange.

1 Like

I know it’s been a while, but thanks to your advice, I was finally able to "fix" odhcp6c, and the IPv6 delegation is finally working!

It took me hours to find out how to compile odhcp6c for the Raspberry Pi with musl, so I just wanted to briefly share what I did (I had to try out my code changes somehow):

  1. clone odhcp6c:
> cd /tmp && git clone https://github.com/openwrt/odhcp6c.git && cd odhcp6c
  1. run cross-compiling docker-container:
> docker run --rm -ti -v "${PWD}:/odhcp6c dockcross/linux-arm64-musl bash
[root:/work] # cd /odhcp6c
[root:/odhcp6c] # cmake -Bbuild -S.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/xcc/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /odhcp6c/build
[root:/odhcp6c] # cd build/
[root:/odhcp6c/build] # make
[ 16%] Building C object CMakeFiles/odhcp6c.dir/src/odhcp6c.c.o
[ 33%] Building C object CMakeFiles/odhcp6c.dir/src/dhcpv6.c.o
[ 50%] Building C object CMakeFiles/odhcp6c.dir/src/ra.c.o
[ 66%] Building C object CMakeFiles/odhcp6c.dir/src/script.c.o
[ 83%] Building C object CMakeFiles/odhcp6c.dir/src/md5.c.o
[100%] Linking C executable odhcp6c
[100%] Built target odhcp6c
[root:/odhcp6c/build] # ls -l odhcp6c
-rwxr-xr-x 1 root root 314912 Oct 10 00:02 odhcp6c
  1. copy binary to the openwrt router (/tmp/odhcp6c) and make a backup of the original binary:
> ssh root@router
root@OpenWrt:~# cp /usr/sbin/odhcp6c /usr/sbin/odhcp6c.original
root@OpenWrt:~# cp /tmp/odhcp6c /usr/sbin/odhcp6c
root@OpenWrt:~# reboot

The PR is located here: https://github.com/openwrt/odhcp6c/pull/90

Again, thank @Cthulhu88 :smiley:

You could've used the SDK instead: https://openwrt.org/docs/guide-developer/toolchain/using_the_sdk

Like my "patch", it's a dirty hack that violates the standard, but we had to employ them because most ISPs hire idiots with zero IPv6 knowledge, see my ISP's recent development: Odhcp6c issue with my ISP's configuration - #5 by Cthulhu88
Anyway, don't submit it as a PR (not that there is anyone there to merge it). Your badly configured ISP is sending a bunch of No Address Available status mixed together with success status, odhcp6c is behaving correctly.

1 Like

Here is the root cause of your problem:

dhcp6 advertise: (IA_NA IAID:1 T1:1800 T2:2880 (IA_ADDR 2a0f:ff00:abcd:81bc::1 pltime:3600 vltime:86400)) (IA_PD IAID:1 T1:21600 T2:32400 (IA_PD-prefix 2a0f:ff00:207:ed00::/56 pltime:43200 vltime:86400))
dhcp6 reply: (IA_NA IAID:1 T1:0 T2:0 (status-code NoAddrsAvail)) (IA_PD IAID:1 T1:21600 T2:32400 (IA_PD-prefix 2a0f:ff00:207:ed00::/56 pltime:43200 vltime:86400))

It's advertising an address, but refusing to assign it to you. You can PROBABLY "fix" it without compiling anything by:

option reqaddress 'none'

Assuming it doesn't send No Address Available, it will have the same effect as your hack, as in, no IPv6 address assigned outside of prefixes and RA.

NOTE: Had you posted this here back then, I could've given you the same info I am giving you now, 2 months earlier.
Also, I guessed it correctly back then: No IPv6 delegation on lan interface - #7 by Cthulhu88 although the problem lies with the address and not the prefix.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.