Re: Changing IP on bridge without disconnecting VMs



On Wed, 2022-07-13 at 08:49 -0500, Dan Williams via networkmanager-list
wrote:
On Wed, 2022-07-13 at 07:57 -0500, Chris Adams via networkmanager-
list
wrote:
I have my primary ethernet interface configured in a bridge in NM,
so
that I can run VMs and have them on the local network directly.  I
needed to change the IP of the host system, but when I ran "nmcli
con
up
br0", NM removed the VM virtual NICs from the bridge.

Is there a way to do this differently so that wouldn't happen? 
It's
not
a common thing of course, but something I have needed to do before.

I think this two step process might work for you:

1) update the connection to remove the old IP and add the new one,
with
something like:

nmcli con <name> mod +ipv4.addresses <new IP>
nmcli con <name> mod -ipv4.addresses <old IP>

2) nmcli dev reapply <bridge interface name>


What Dan says is correct.

Just to add, there is also `nmcli device modify "$IFNAME"
ipv4.addresses <new IP>`, which does something similar, but without
modifying the persistent profile. An that case, the change is
ephemeral.


Thomas



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]