espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.79k stars 7.31k forks source link

Impossible to set a static IPv6 address on an interface (IDFGH-13067) #14012

Open eriksl opened 5 months ago

eriksl commented 5 months ago

Answers checklist.

General issue report

This is related to "Static ip address of IPV6 (IDFGH-11369) #12515".

With the comment there, it's probably possible to set a static IPv6 address. The definition of this function still needs to be moved to a public header so we can actually use it, and it will be included in the documentation.

But besides that, there is no way to add a netmask or a gateway to the IPv6 address. I assume that LWIP assumes netmask for ipv6 is always 64 bits. This is an invalid assumption but I guess Espressif can't fix that (other than put some pressure on the LWIP guys).

Also there is no way to specify the default gateway. Using SLAAC this works, but I don't want to use SLAAC because it can only work on /64 netmasks AND I don't like the long addresses (I prefer using face:b00c:1::1 style).

It might work if you combine SLAAC to obtain the default gw and then add an additional, /64 netmasked address, is that correct? So it can never work without SLAAC...

eriksl commented 5 months ago

Update, it appears to work without SLAAC (a static address). But only when the netmask is /64. I am wondering how the default gateway is determined. Peeking at incoming non-local packets? Sending to ff02::2 and see who replies? Kind of ugly in my opinion.