eth0:1 aliases in NM, manual setup
Andrei Borzenkov
arvidjaar at gmail.com
Mon Jul 22 11:24:23 UTC 2024
On Mon, Jul 22, 2024 at 12:59 PM Thomas Haller <thaller at redhat.com> wrote:
>
> On Mon, 2024-07-22 at 12:45 +0300, Andrei Borzenkov wrote:
> > On Mon, Jul 22, 2024 at 11:17 AM Íñigo Huguet <ihuguet at redhat.com>
> > wrote:
> >
> >
> > AFAIU kernel considers the very first interface address for a given
> > subnet/scope as primary and all addresses for the same combination of
> > subnet/scope added later as secondary. So, to keep the specific
> > address as primary it has to be configured first. I suspect legacy
> > scripts implicitly processed ifcfg-ethX before ifcfg-ethX:N, so
> > address in ifcfg-ethX became primary.
> >
> > Does NetworkManager process ipv4.addresses in deterministic order?
> > Can
> > we rely that for "ipv4.addresses A1 A2 A3" it will always add A1
> > first, then A2, then A3? Especially with DHCP where there could be
> > delay waiting for completion of the DHCP transaction.
> >
>
> Hi,
>
> It works.
>
> Addresses can become ready for configuration in any order. For example,
> if you do DAD/ACD. Or if you do `nmcli device modify DEV ipv4.addresses
> ADDRS`.
>
> When NetworkManager notices that the order is not as required, it will
> delete and re-add them in the right order.
>
>
> The complexity of getting that right, is considerable. It's here:
> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/777418dfd786722d4dc16d4e60d2ca724f93b55c/src/libnm-platform/nm-platform.c#L4327
>
Thank you! It is even documented :)
Is there deterministic order between different methods? I.e. suggested
ipv4.method=auto
ipv4.addresses=x.y.z.w/M
Which one has priority and becomes primary - from DHCP or static?
More information about the Networkmanager
mailing list