Create a Bridge for KVM QEMU using NetworkManager

I’m trying to create working connection from QEMU Virt clients to the Internet. I want to do this solily with Network manager what I did:

  1. In NetworkManager removed the (working) WiFi connection. I want to use that for the bridge
  2. Create a new connection, set it to bridge and called it WiFi Bridge with Interface name virbr0.
  3. Added my physical adaptor to this bridge, providing WiFi credentials
  4. Created a vm Windows with all virtio drivers installed and connected this to virbr0

Result:

  • On the host the Wifi Bridge is listed as Connected
  • On the client I see an ip address assigned to the adaptor, and I can successfully ping the Gateway
  • On the client I can not ping 9.9.9.9
  • On the client the gateway IP is the adress the ip in the status of the bridge in NetworkManager
  • On the client that same address is DNS
  • On the host I can also ping this IP Adress.

This looks like a routing problem in the bridge network but I am no entirly shure. What do I have to setup additionally on the bridge so that is can connect to the internet?

Hi!
You can’t have a bridge on WiFi afaik. This is because you can only have one mac address per interface. You can on ethernet though.
VMware and Virtualbox are using a non-standard way.

1 Like

Thanks

So I do the same thing with eth.

  1. Remove the default eth connection
  2. create a bridge and add the physical adaptor
  3. setup the rest as illustrated.

From the client

  • I have access to the host (the webserver running there)
  • but not to the internet

But I also see that the dns configured (the host ip) is not resolving. (insert “It’s always DNS meme here”)

Not sure why. The way I understand is that bridge should act as DHCP (which it does, client gets ip) and DNS (relay) which it doesn´t. based on an internal dnsmasq if I’m not mistaken.


A shared host bridge using Ethernet is created like this:
How to make a Virtual Machine present itself to my home network as if it were another physical computer - #7 by vgaetera

As mentioned above, Wi-Fi client is not supported for this setup.

Assuming you configured it correctly, IP and DNS for both host and guests can be obtained with DHCP from your LAN router, so the host does not need to run any DNS server or forwarder.

Do not confuse the shared host bridge with the default virtual network bridge virbr0, so better use a different interface name to avoid conflicts.

Ok. I can use the ehternet from my docking station or the build in ethernet connect. How do I do this with NetworkManager?

If I follow the steps from your link I see:

Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/20)
NAME             UUID                                  TYPE      DEVICE          
SBW-Intern       718226cd-3a29-44d6-85a6-ae32aaf76a14  wifi      wlp0s20f3       
ether            2c352ea0-5924-4469-900f-5650a9377e40  ethernet  eth0            
bridge           1b34b4f0-acca-4393-bf8d-a420f4caf096  bridge    br0             
br-8db316c5c190  1b26e65c-c7d7-4248-8d20-763b227efc1c  bridge    br-8db316c5c190 
lo               a79ef5e8-f959-4c42-b0cf-e13d6c6280a9  loopback  lo              
br-b6e0e86b13ae  3c679527-d8f6-4917-b6aa-1f3ed900f3fb  bridge    br-b6e0e86b13ae 
docker0          d3e85b8b-b695-4212-b6f0-e07e33bde498  bridge    docker0         
Docked           ea7a2607-d327-489d-81dc-fca318da0867  ethernet  --              
Ethernet intern  f046eb3c-ed3d-4d88-8f19-69580b935c3f  ethernet  --              
MG1              c02cdb68-145f-49ba-baee-71bfac0824df  wifi      --              
mob-fp6          dfc0a6e5-126a-4786-ae7c-8fdb3cb2afd2  wifi      --              
Error: unknown connection 'Wired connection 1'.
Error: cannot delete unknown connection(s): 'Wired connection 1'.

Also If I select br0 in the VM it is not connected.

Ok. This worked.
Things to remember:

  • The device name in the vm is br0
  • Our campus requires a logon for internet access. This has to be done from within the VM as well as from the host

This apparently cannot be done from with Networkmanager only (???)

The bridge in NetworkManager looks like:



For my information:
The docker network looks like:

1 Like