eth0:1 aliases in NM, manual setup
Martin Vogt
mvogt1 at gmail.com
Thu Jul 4 11:18:33 UTC 2024
Hello,
I have to migrate a server IP to a new NM managed server, which I setup.
The new server has the primary IP cups6 192.168.48.46/24 (ens224) and dhcp
on boot.
I like to add a manual IP 192.168.48.16 like in the old setup, on cups5:
ens224: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.48.20 netmask 255.255.255.0 broadcast 192.168.48.255
ens224:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.48.16 netmask 255.255.255.0 broadcast 192.168.48.255
ifcfg-ens224:1
# cups ontop of cups5
DEVICE="ens224:1"
BOOTPROTO="static"
ONBOOT="manual"
IPADDR="192.168.48.16"
NETMASK="255.255.255.0"
When doing it with NM:
nmcli connection modify ens224 +ipv4.addresses 192.168.48.16/24 ipv4.method
manual
- it reorders the interfaces, ens224:1/192.168.48.16 becomes primary and
- 192.168.48.46/24 secondary
- both are started auto or manually
But it should be:
primary: 192.168.48.46/24 with dhcp onboot
second: 192.168.48.16 manual / static
Currently I'm doing (without NM):
ip addr add 192.168.48.16/24 dev ens224 label ens224:1
ip addr del 192.168.48.16/24 dev ens224 label ens224:1
Another approach was, adding a new interface:
> nmcli c add ifname ens224 type ethernet con-name ens224_1
Connection 'ens224_1'successfully added.
> nmcli connection modify ens224_1 +ipv4.addresses 192.168.48.16/24
ipv4.method manual
> nmcli con up ens224_1
Connection successfully activated
But this removes the existing ens224 interface and ens224_1 becomes the
only one.
best regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20240704/d19f3cb9/attachment.htm>
More information about the Networkmanager
mailing list