I have verified the fix using systemd 249.11-0ubuntu3.10 from jammy-proposed:
The VM and test networks are already configured on my system:
nr@six:/t/tmp.jTS3wdPdT3$ virsh list
Id Name State
-----------------------------------
8 clean-jammy-amd64 running
nr@six:/t/tmp.jTS3wdPdT3$ virsh net-list
Name State Autostart Persistent
--------------------------------------------
default active yes yes
no-dhcp active no no
I have verified the fix using systemd 249.11-0ubuntu3.10 from jammy-proposed:
The VM and test networks are already configured on my system:
nr@six: /t/tmp. jTS3wdPdT3$ virsh list ------- ------- ------- -------
Id Name State
-------
8 clean-jammy-amd64 running
nr@six: /t/tmp. jTS3wdPdT3$ virsh net-list ------- ------- ------- ------- ------- --
Name State Autostart Persistent
-------
default active yes yes
no-dhcp active no no
nr@six: /t/tmp. jTS3wdPdT3$ virsh net-dumpxml --network default default< /name> 04260896- 2701-422d- 84e0-8e0df1122d b3</uuid> '52:54: 00:bd:9f: 3a'/> '192.168. 122.1' netmask= '255.255. 255.0'> 192.168. 122.2' end='192. 168.122. 254'/>
<network connections='2'>
<name>
<uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address=
<ip address=
<dhcp>
<range start='
</dhcp>
</ip>
</network>
nr@six: /t/tmp. jTS3wdPdT3$ virsh net-dumpxml --network no-dhcp no-dhcp< /name> 2c047740- caab-4c90- 8421-70da6732a7 59</uuid> '52:54: 00:ac:12: 45'/> '172.16. 1.1' netmask= '255.255. 0.0'>
<network>
<name>
<uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr1' stp='on' delay='0'/>
<mac address=
<ip address=
</ip>
</network>
Running the test case:
(Host)
nr@six: /t/tmp. jTS3wdPdT3$ virsh detach-interface clean-jammy-amd64 network
Interface detached successfully
(VM)
root@clean- jammy-amd64: /home/nr# apt-cache policy systemd archive. ubuntu. com/ubuntu jammy-proposed/main amd64 Packages security. ubuntu. com/ubuntu jammy-proposed/main amd64 Packages dpkg/status 11-0ubuntu3. 9 500 archive. ubuntu. com/ubuntu jammy-updates/main amd64 Packages 11-0ubuntu3. 7 500 security. ubuntu. com/ubuntu jammy-security/main amd64 Packages 11-0ubuntu3 500 archive. ubuntu. com/ubuntu jammy/main amd64 Packages jammy-amd64: /home/nr# cat > /etc/systemd/ network/ 10-dhcp. network << EOF
systemd:
Installed: 249.11-0ubuntu3.10
Candidate: 249.11-0ubuntu3.10
Version table:
*** 249.11-0ubuntu3.10 500
500 http://
500 http://
100 /var/lib/
249.
500 http://
249.
500 http://
249.
500 http://
root@clean-
[Match]
Name=en*
[Network] jammy-amd64: /home/nr# systemctl restart systemd-networkd
DHCP=yes
EOF
root@clean-
(Host)
nr@six: /t/tmp. jTS3wdPdT3$ virsh attach-interface clean-jammy-amd64 network no-dhcp
Interface attached successfully
(VM)
root@clean- jammy-amd64: /home/nr# networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
3 ens3 ether degraded configuring
2 links listed. jammy-amd64: /home/nr# /lib/systemd/ systemd- networkd- wait-online --any --timeout 10 jammy-amd64: /home/nr# networkctl
root@clean-
Timeout occurred while waiting for network connectivity.
root@clean-
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
3 ens3 ether carrier configuring
2 links listed.
(Host)
nr@six: /t/tmp. jTS3wdPdT3$ virsh attach-interface clean-jammy-amd64 network default
Interface attached successfully
(VM)
root@clean- jammy-amd64: /home/nr# /lib/systemd/ systemd- networkd- wait-online --any --timeout=0
root@clean- jammy-amd64: /home/nr# echo $? jammy-amd64: /home/nr# networkctl
0
root@clean-
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
3 ens3 ether degraded configuring
5 ens9 ether routable configured
3 links listed.