nmcli interface aliases

Thomas Haller thaller at redhat.com
Fri Apr 26 08:28:26 UTC 2024


On Tue, 2024-04-23 at 20:04 -0400, Michael DiDomenico wrote:
> is there an nmcli equivalent to this?
> 
> [root]# ip add add 192.168.12.29/24 dev enp0s13f0u1 label
> enp0s13f0u1:1 broadcast 192.168.12.255 noprefixroute
> [root]# ip ad show enp0s13f0u1
> 2: enp0s13f0u1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> fq_codel state UP group default qlen 1000
>     link/ether a0:ce:c8:b2:22:f7 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.10.29/24 brd 192.168.10.255 scope global
> noprefixroute enp0s13f0u1
>        valid_lft forever preferred_lft forever
>     inet 192.168.12.29/24 brd 192.168.12.255 scope global
> noprefixroute enp0s13f0u1:1
>        valid_lft forever preferred_lft forever
> 
> i know i can do this, but it doesn't give me the labelled :1
> interface
> 
> [root]# nmcli c modify Wired\ connection\ 1 ipv4.addresses
> "192.168.10.29/24,192.168.12.29/24"
> [root]# nmcli c up Wired\ connection\ 1 
> Connection successfully activated (D-Bus active path:
> /org/freedesktop/NetworkManager/ActiveConnection/19)
> [root]# ip a show enp0s13f0u1
> 2: enp0s13f0u1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> fq_codel state UP group default qlen 1000
>     link/ether a0:ce:c8:b2:22:f7 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.10.29/24 brd 192.168.10.255 scope global
> noprefixroute enp0s13f0u1
>        valid_lft forever preferred_lft forever
>     inet 192.168.12.29/24 brd 192.168.12.255 scope global
> noprefixroute enp0s13f0u1
>        valid_lft forever preferred_lft forever

Hi

Support for labels (IFA_LABEL) is only partially implemented. For the
most parts, it's not supported.

In the source code, see nm_ip_address_set_attribute() and
NM_IP_ADDRESS_ATTRIBUTE_LABEL.

In particular, nmcli and keyfile format do not (currently) support any
address attributes.

Missing feature. Patches welcome.


Thomas



More information about the Networkmanager mailing list