Recently libvirt networking has caused me headaches - host loses connection once libvirt sets up a route in the kernel routing table. What I found was a strange default entry (interface vnet0, which is supposed to be the VM's interface) that routes back to itself. A traceroute found that all outgoing connection indeed are stopped at the vnet0 interface.

These are my system information:

# libvirtd --version
3.0.0

# uname -a
Linux cbpp 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u2 (2018-02-21) x86_64 GNU/Linux

And what I observed:

# # Before VM starts
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.43.1    0.0.0.0         UG    0    0        0 wlxe8de271c3ce3
192.168.43.0    0.0.0.0         255.255.255.0   U     0    0        0 wlxe8de271c3ce3
192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

# # After VM starts
# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     0      0        0 vnet0
default         192.168.43.1    0.0.0.0         UG    0    0        0 wlxe8de271c3ce3
link-local      0.0.0.0         255.255.0.0     U     0      0        0 vnet0
192.168.43.0    0.0.0.0         255.255.255.0   U     0    0        0 wlxe8de271c3ce3
192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

# # Before VM starts
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  192.168.43.1 (192.168.43.1)  4.703 ms  5.376 ms  5.352 ms
 2  * * *
 3  10.82.40.177 (10.82.40.177)  220.418 ms 10.82.40.49 (10.82.40.49)  246.759 ms  46.355 ms
 4  10.82.3.66 (10.82.3.66)  138.574 ms 10.82.2.78 (10.82.2.78)  52.183 ms 10.82.2.66 (10.82.2.66)  46.292 ms
 5  google-public-dns-a.google.com (8.8.8.8)  58.262 ms  58.743 ms  59.467 ms

# # After VM starts
# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  cbpp.local (169.254.27.41)  3079.602 ms !H  3079.540 ms !H  3079.522 ms !H

What could possibly cause this? Is it a bug? Has anyone seen the same problem? Any help would be much appreciated. Thanks

edit: as per @Michael Hampton's request, libvirt network configuration as follows, plus the network config all my VMs use:

default network of libvirt:

<network>
  <name>default</name>
  <forward mode='nat'/>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:b8:6e:e3'/>
  <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>

typical domain network nic:

<interface type='network'>
  <mac address='52:54:00:c5:cd:82'/>
  <source network='default'/>
  <model type='rtl8139'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0    x0'/>
</interface>
  • What is the libvirt networking configuration? – Michael Hampton Apr 15 at 4:03
  • I have updated my question, please have a look : ) – Chung Lun Yuen Apr 15 at 5:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.