static ipv4 and ipv6 -> ipv6 problem after iphone reset

Started by RamSense, May 18, 2023, 07:28:29 AM

Previous topic - Next topic
I have a question on how to solve failing static ipv6 with e.g. an Iphone after factory reset.

1. Static ipv4 works by MAC address, this seems to work fine, even when an iphone gets reinstalled by factory reset settings / clean install. The iphone/device gets again the static ipv4 address (by the MAC address).

2. Static ipv6 does not work like ipv4 above. I think it has to do with static ipv6 working with DUID, after the factory reset of the Iphone it looks like opnsense/DHCP "thinks" that this device is new and gives out a new IPV6 address.

The above results in the device correctly being given the earlier ipv4 address, as i would like, but is given a new IPV6 address instead of the static address aasigned earlier.

Is there a way to solve this and being able to have static ipv6 as static as with ipv4?
Deciso DEC850v2

I am not an Xpert! Thing about apple is: The mac address will change! Private Wi-Fi address. Have to set-up manually. It can be a fight!

Thank you for your reply and input.

It looks like the last 12 digits of the DUID stays the same and is exactly the MAC address (and used with ipv4). From the DUID at least the first 4 - 6 digits stay the same also. Some others in between change after a new install/reset of the iphone, ipv4 gets connected correctly by mac, ipv6 not by DUID.

On this https://docs.netgate.com/pfsense/en/latest/config/advanced-networking.html#dhcp6-duid netgate site i found this:
QuoteThe firewall generates a DUID automatically, but in some cases, an administrator may want to use a different DUID. For example, if the operating system was reinstalled and the firewall should use the same DUID it had in the past, or if an upstream network administrator requires a specific DUID.

So it looks like it should be possible (?) Would be great being able to get both ipv4 and ipv6 static in all scenario's....
Deciso DEC850v2

Just thinking and asking if it is possible, a sollution could be to get it to work like ipv4 static ip does with mac address to being able to use the DUID with only the last 12 digits, the mac address, or some wildcard with the last 12 digits containing the MAC.

Some experienced ipv6 member around here with knowledge on how to get the static ipv6?!
Deciso DEC850v2

one step further - i think :-)
at interfaces-settings-DHCP Unique Identifier -> info it described:
QuoteThis field can be used to enter an explicit DUID for use by IPv6 DHCP clients.
The correct format for each DUID type is as follows, all entries to be in hex format "xx" separated by a colon.
LLT: 4 bytes "00:01:00:01" followed by 4 bytes Unix time e.g. "00:01:02:03", followed by 6 bytes of the MAC address.
LL: 4 bytes "00:03:00:01" followed by 6 bytes of the MAC address.
UUID: 4 bytes "00:00:00:04" followed by 8 bytes of a universally unique identifier.
EN: 2 bytes "00:02" followed by 4 bytes of the enterprise number e.g. "00:00:00:01", followed by a variable length identifier of hex values up to 12

this type [LL: 4 bytes "00:03:00:01" followed by 6 bytes of the MAC address.] looks like the solution. BUT

when i added a manual 00:03:00:01:XX:XX:XX:XX:XX:XX (XX mac address) the device does not connect with the static ip but a given ipv6 from opnsense-dhcp. So I think i'm close, but still help needed....
Deciso DEC850v2

after setting interfaces - settings - DHCP Unique Identifier -> to -> LL: 4 bytes "00:03:00:01" followed by 6 bytes of the MAC address. (for me trying to see if i could get a close approach of the static ipv4 method by mac address) and after reboot,

some static ipv6 addresses DUID where converted to 00:03:00:01xxx while others where still unchanged 00:01:00:01:xxxx and still not getting the sticky ipv4 static experience with the ipv6 ip's....

Can somebody explain further what this is or should have worked? Or is there something not completely working with ipv6?
Deciso DEC850v2