[Networkmanager] NetworkManager link local IPv4 address based on last 2 octets of ethernet MAC address

manjunatha srinivasan manjunathan.n at gmail.com
Fri Oct 20 10:21:26 UTC 2023


Hi Andrei
Thanks for your valuable information and clarification.
Regards
Manjunatha Srinivasan N


On Thu, 19 Oct 2023 at 18:00, Andrei Borzenkov <arvidjaar at gmail.com> wrote:

> On Thu, Oct 19, 2023 at 3:18 PM manjunatha srinivasan
> <manjunathan.n at gmail.com> wrote:
> >
> > Hi
> > I have 2 following ethernet profiles at
> /etc/NetworkManager/system-connections:
> > One for dynamic ip configuration and other for link local as fallback
> when DHCP server is not reachable. As expected when DHCP server is not
> reachable, fall back IPv4 address happens e.g. 169.254.105.20 with subnet
> mask as 255.255.0.0 by the NetworkManager.
> > This particular IP address is always the same which is expected one.
>
> You can not expect this. There is always the possibility of address
> collision and NetworkManager will then generate a different address.
>
> > Please let me know how this constant IPv4 address is decided by the
> NetworkManager.
>
> By default it hashes the interface MAC address.
>
> > Also let me know if there is any configuration option in NetworkManager
> to change last 2 octets (i.e.105.20) represented in the decimal value of
> last 2 values of ethernet MAC hex address.
> >
>
> It is not guaranteed to be unique. Besides, you have two addresses
> less than 2 octets, so for some MAC this cannot be used at all.
>
> > Ethernet (eth0) method based on DHCP:
> > [connection]
> > id=my-eth0
> > uuid=8466b654-0183-4900-a2d6-26a9e6af275e
> > type=ethernet
> > autoconnect-priority=1
> > interface-name=eth0
> > timestamp=1697699281
> >
> > [ethernet]
> >
> > [ipv4]
> > dhcp-timeout=10
> > method=auto
> >
> > [ipv6]
> > addr-gen-mode=stable-privacy
> > method=auto
> > ra-timeout=10
> >
> > [proxy]
> > -------------------
> > Ethernet (eth0) method based on link-local:
> > root at FXR90D5FB72:/etc/NetworkManager/system-connections# cat
> rfid-ll-eth0.nmconnection
> > [connection]
> > id=ll-eth0
> > uuid=f07f43e6-59c8-428f-bc04-55a0e581e621
> > type=ethernet
> > interface-name=eth0
> >
> > [ethernet]
> >
> > [ipv4]
> > method=link-local
> >
> > [ipv6]
> > addr-gen-mode=stable-privacy
> > method=auto
> >
> > [proxy]
> > ------
> >
> > When DHCP request fails, the IPv4 address fallback to
> >
> >
> >
> > Thanks & Regards
> > Manjunatha Srinivasan N
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20231020/ff485f98/attachment.htm>


More information about the Networkmanager mailing list