Virt-Manager - NIC link state set to down, but guest network still connected

Fedora 33 fully updated.
libvirt-daemon-kvm-6.6.0-5.fc33.x86_64
emu-system-x86-5.1.0-9.fc33.x86_64
qemu-kvm-5.1.0-9.fc33.x86_64

Under virt-manager (3.2.0), guest details, NIC setting, link active box is cleared.
XML of the NIC as copied from virt-manager:

But when I boot up the guest (a new install of windows 10, w/o any virtio drivers installed), Internet access is working.

Is the link state setting in virt-manager not working as expected?

1 Like

It works for me on the following config:

  • KVM/QEMU @ session mode
  • VirtIO NIC @ NAT forward
  • Linux VMs

The change applies without restarting VMs.

> virsh dumpxml openwrt1 | xmllint --xpath /domain/devices/interface -
<interface type="bridge">
      <mac address="52:54:00:8b:73:59"/>
      <source bridge="virbr0"/>
      <target dev="tap0"/>
      <model type="virtio"/>
      <link state="up"/>
      <alias name="net0"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
    </interface>

> sudo virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>7ef14652-23b3-4bf8-a46e-03c40ebac980</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:4d:b1:00'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

I guess this requires additional troubleshooting to isolate the issue.

1 Like

I have try the following:

  1. Restart libvirtd, result same.
  2. Reboot host, result same.
  3. Add 2nd NIC to the guest, result same (for both NICs)
  4. Create a new VM guest by import the same qcow2 image. Boot it up with link enabled. Then take link down via virt-manager. Link is down inside guest correctly.
  5. Shutdown guest, boot it up with link state down. And again, network is up and running inside the guest.

So this issue is not specific to a particular guest and it do not occur for the first boot.

1 Like

Try to boot the same guest VM with a Linux live CD/DVD.

1 Like

Yes.

I use Server-netinst ISO to boot and the network is here for Anaconda to load and finish installation as dual boot.

So the network link is here for: Server-netinst, Win10 and FedoraServer.

1 Like

If the problem persists on a Linux system, it might be related to the VM configuration.
Please post the relevant parts of your configs:

virsh list --all
virsh dumpxml vm_name | xmllint --xpath /domain/devices/interface -

sudo virsh net-list --all
sudo virsh net-dumpxml vnet_name
#virsh list -all
Id   Name                     State
-----------------------------------------
 1    win10                    running
 -    silverblue-rawhide       shut off
 -    win10-testniclinkstate   shut off

#virsh dumpxml win10 | xmllint --xpath /domain/devices/interface -
<interface type="network">
      <mac address="52:54:00:8f:8a:4b"/>
      <source network="default" portid="a657401a-9d3c-463a-9229-5ada80df8fde" bridge="virbr0"/>
      <target dev="vnet0"/>
      <model type="e1000e"/>
      <link state="down"/>
      <alias name="net0"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>
<interface type="network">
      <mac address="52:54:00:6a:99:a6"/>
      <source network="default" portid="3bbc2cf5-a5cc-445c-af2e-e9abf60f65e5" bridge="virbr0"/>
      <target dev="vnet1"/>
      <model type="e1000e"/>
      <link state="down"/>
      <alias name="net1"/>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </interface>

sudo virsh dumpxml win10-testniclinkstate | xmllint --xpath /domain/devices/interface -

<interface type="network">
      <mac address="52:54:00:c9:ac:68"/>
      <source network="default"/>
      <model type="e1000e"/>
      <link state="down"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>

#virsh net-list --all
 Name      State    Autostart   Persistent
--------------------------------------------
 default   active   yes         yes

#virsh net-dumpxml default
<network connections='2'>
  <name>default</name>
  <uuid>7bc352b7-5003-4591-a7e8-b249c36b55a6</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:cd:6b:a8'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>
1 Like

Try this way:

Yes, once driver changed to virtio, Fedora gueust worked correctly.

Downloading virtio-win to see what happens in Windows guest.

Update:
Yes, the virtio NIC driver works correctly regarding the link state as set in virt-manager, in both Fedora and Windows guest.

While the e1000e driver is always connected no matter what the link state is set.

Bug filed as: 1927669 ā€“ e1000e NIC do not respect link state set in virt-manager

2 Likes

Iā€™m afraid this feature might be exclusive to the VirtIO device type as a preferred configuration method, while other options are there mostly as a failover until the user installs the proper driver.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.