<div dir="ltr">Hi Thomas Haller<div><br><div>Thanks for your valuable information and clarification. I tested the behaviour of a change in IPv4 address at device side, when another device is in link local network for the same static IPv4 address.<br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Regards<br>Manjunatha Srinivasan N</div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 19 Oct 2023 at 18:04, Thomas Haller <<a href="mailto:thaller@redhat.com">thaller@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2023-10-19 at 17:48 +0530, manjunatha srinivasan wrote:<br>
> Hi <br>
> I have 2 following ethernet profiles at /etc/NetworkManager/system-<br>
> connections: <br>
<br>
btw, you can also enable LL additionally with DHCP. Then DHCP is<br>
attempted in the background, while you always have a LL address. See<br>
"ipv4.link-local" setting in `man nm-settings`. That is IMO better than<br>
two profiles.<br>
<br>
> One for dynamic ip configuration and other for link local as fallback<br>
> when DHCP server is not reachable. As expected when DHCP server is<br>
> not reachable, fall back IPv4 address happens e.g. 169.254.105.20<br>
> with subnet mask as 255.255.0.0 by the NetworkManager. <br>
> This particular IP address is always the same which is expected one. <br>
> Please let me know how this constant IPv4 address is decided by the<br>
> NetworkManager.<br>
<br>
IPv4LL is documented by RFC<br>
<a href="https://datatracker.ietf.org/doc/html/rfc3927#section-2.1" rel="noreferrer" target="_blank">https://datatracker.ietf.org/doc/html/rfc3927#section-2.1</a><br>
<br>
The code is here:<br>
<a href="https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/94ead251ded1ed7d3a1ea9953f041708daf3787f/src/core/nm-l3-ipv4ll.c#L382" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/94ead251ded1ed7d3a1ea9953f041708daf3787f/src/core/nm-l3-ipv4ll.c#L382</a><br>
<br>
It basically hashes the MAC address and a generation counter.<br>
<br>
> Also let me know if there is any configuration option in<br>
> NetworkManager to change last 2 octets (i.e.105.20) represented in<br>
> the decimal value of last 2 values of ethernet MAC hex address. <br>
<br>
The address couldn't be fixed, because there is always the possibility<br>
that another host on your network already picked this address. It falls<br>
back to a retry via the generation counter.<br>
<br>
In any case, there is no option in NetworkManager (or RFC) to influence<br>
the IPv4LL address in a more immediate way.<br>
<br>
> <br>
> Ethernet (eth0) method based on DHCP:<br>
> [connection]<br>
> id=my-eth0<br>
> uuid=8466b654-0183-4900-a2d6-26a9e6af275e<br>
> type=ethernet<br>
> autoconnect-priority=1<br>
> interface-name=eth0<br>
> timestamp=1697699281<br>
> <br>
> [ethernet]<br>
> <br>
> [ipv4]<br>
> dhcp-timeout=10<br>
> method=auto<br>
> <br>
> [ipv6]<br>
> addr-gen-mode=stable-privacy<br>
> method=auto<br>
> ra-timeout=10<br>
> <br>
> [proxy]<br>
> -------------------<br>
> Ethernet (eth0) method based on link-local:<br>
> root@FXR90D5FB72:/etc/NetworkManager/system-connections# cat rfid-<br>
> ll-eth0.nmconnection<br>
> [connection]<br>
> id=ll-eth0<br>
> uuid=f07f43e6-59c8-428f-bc04-55a0e581e621<br>
> type=ethernet<br>
> interface-name=eth0<br>
> <br>
> [ethernet]<br>
> <br>
> [ipv4]<br>
> method=link-local<br>
> <br>
> [ipv6]<br>
> addr-gen-mode=stable-privacy<br>
> method=auto<br>
> <br>
> [proxy]<br>
> ------<br>
> <br>
> When DHCP request fails, the IPv4 address fallback to <br>
> <br>
> <br>
> <br>
> Thanks & Regards<br>
> Manjunatha Srinivasan N<br>
<br>
</blockquote></div>