I have on the host machine two network interfaces. One is lan and the other is a wlan. For libvirt I have created a nat network which is bound to the wlan. From the guest I can access other machines in the network host wlan is connected to. Also DNS lookup works. The problem is that there’s no connection to the internet at all, e.g. pinging something gives “Destination network unreachable”. This only happens when both network connection on the host are active. Running qemu/libvirt on OpenSuse Tumbleweed.

The nat network in question:

<network>
  <name>natToWlan</name>
  <uuid>a44c939c-e6bf-44d0-8f86-376056d418a4</uuid>
  <forward dev="wlp19s0f4u1u1" mode="nat">
    <nat>
      <port start="1024" end="65535"/>
    </nat>
    <interface dev="wlp19s0f4u1u1"/>
  </forward>
  <bridge name="virbr1" stp="on" delay="0"/>
  <mac address="52:54:00:1f:64:95"/>
  <ip address="192.168.100.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.100.128" end="192.168.100.254"/>
    </dhcp>
  </ip>
</network>
  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    6 months ago

    This is not great practice. You should get a dedicated Ethernet card for wlan and then block list the device on the host. The way your doing it is a little more complicated and is a security risk if the VM stops running for some reason.