From 135d16792e391bb70409f2e90e75d9b2fbfa3ca9 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 14 Jul 2021 19:48:14 +0200 Subject: [PATCH] copr-be: converge the ipv6 networking faster --- roles/copr/backend/templates/provision/libvirt-new | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/copr/backend/templates/provision/libvirt-new b/roles/copr/backend/templates/provision/libvirt-new index 3e0c70b6db..1dea1c7dc8 100755 --- a/roles/copr/backend/templates/provision/libvirt-new +++ b/roles/copr/backend/templates/provision/libvirt-new @@ -321,12 +321,16 @@ class LibvirtSpawner: """ self.boot_options += ['--network', 'bridge=br0,model=virtio'] self.append_startup_script("\n".join([ - "echo ahoj >> /var/tmp/ahoj", f"nmcli con add con-name '{con_name}' ifname {device} " - "type ethernet", + # Don't automatically start, otherwise DHCPv4 starts, too. + "type ethernet autoconnect no", f"nmcli con modify '{con_name}' ipv6.address {ipv6_addr}", f"nmcli con modify '{con_name}' ipv6.gateway {ipv6_gw}", f"nmcli con modify '{con_name}' ipv4.method disabled", + f"nmcli con up '{con_name}'", + # This makes the IPv6 networking to converge faster + 'for _ in `seq 180`; do ping6 -c 1 fedoraproject.org && break ; sleep 1; done', + ])) self.ipv6 = ipv6_addr.split("/")[0]