From 64a3b97a963ae3baeb83a689fba181d2785ee169 Mon Sep 17 00:00:00 2001 From: bluebluesoda <300733005+bluebluesoda@users.noreply.github.com> Date: Fri, 18 Sep 2026 20:25:08 +0000 Subject: [PATCH] fix(transfer): actually drop a RHEL guest's IPv6 on a host that has none MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A container moving to a host with no IPv6 has to lose the address it carried, and on RHEL-family guests that means telling NetworkManager, not editing a file. NetworkManager will not accept the change in the obvious order — a method of "manual" requires an address, and an address is not allowed under a method of "disabled" — so the guest still came up with the address from the host it left. Setting the whole final state in one request is what it accepts. Verified with an AlmaLinux 9 guest in both directions against a prefix-mode and a pool-mode host: moved to the prefix host it came back up with one bridged NIC carrying this host's IPv4 and IPv6 (which required re-enabling the IPv4 that the pool-mode layout had disabled on that NIC); moved to the pool host it came up pure IPv4 with ipv6.method disabled and no global address at all. Co-authored-by: CommandCodeBot --- src/internal/mgr/transfer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/internal/mgr/transfer.go b/src/internal/mgr/transfer.go index b762e42..e3ad4d2 100644 --- a/src/internal/mgr/transfer.go +++ b/src/internal/mgr/transfer.go @@ -567,7 +567,11 @@ if command -v nmcli >/dev/null 2>&1 && ! systemctl is-active systemd-networkd >/ CONN=$(nmcli -t -f NAME,DEVICE con show 2>/dev/null | awk -F: '$2 == "eth0" {print $1; exit}') [ -z "$CONN" ] && CONN=$(nmcli -t -f NAME con show 2>/dev/null | grep -i eth0 | head -1) if [ -n "$CONN" ]; then - nmcli con mod "$CONN" ipv6.method disabled >/dev/null 2>&1 || true + # The address and the method have to be cleared together: NetworkManager + # refuses a method of "manual" with no address left, and refuses an + # address under a method of "disabled", so only the final state, set in + # one request, is accepted. + nmcli con mod "$CONN" ipv6.method disabled ipv6.addresses "" ipv6.gateway "" >/dev/null 2>&1 || true nmcli con up "$CONN" >/dev/null 2>&1 || true fi fi