On Mon, 2019-09-16 at 06:04 +0000, Yannick MOLINET wrote:
> Hi all,
>
> I’m searching how to add an network alias (and not a secondary ip) on
> a network interface, like eth0:0 or ens3:1 or dummy0:4, with Network
> Manager (nmcli).
Hi,
These "aliases" are implemented by kernel by attaching a "label" to the address (IFA_LABEL).
This is what you see in the deprecated `ifconfig` command line tool. But beyond that, the label is
not really useful (is it?) and only partly supported by NetworkManager. But multiple IP addresses work,
of course.
Why do you need the label? Just configure multiple IP addresses:
$ nmcli connection modify "$PROFILE" ipv4.addresses "192.168.5.100/24,192.168.6.100/24"
$ nmcli connection modify "$PROFILE" +ipv4.addresses "192.168.7.100/24"
Note that the ifcfg-rh settings plugin of NetworkManager supports the
label, but the keyfile plugin does not. That's
a severe limitation, to the point where it's not useful. Also, nmcli
does not support the label...
best,
Thomas