There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

vole , (edited )
@vole@lemmy.world avatar

I haven’t made a bridge to a VM before today, or made a bridge with Network Manager. That being said, I was able to persuade Network Manger to get a bridge working, and there are a few things I can note:

  • When you setup the bridge, the host network interface should become a slave to the bridge. This means that the physical network interface should not have an IP Address, and your bridge should now be where you configure the host’s IP address.

    • After you start the VM, you should be able to run ip link | grep ‘master br0’ on the host, and it should display 2 interfaces which are slaves to br0. One for the physical ethernet interface, one for the VM (vnet). And it should only list your ethernet interface when the VM is off.
  • The RedHat tutorial does not show the bridge and the host having different IP addresses, the RedHat tutorial shows the bridge and the guest having different IP addresses. Actually, no, the RedHat tutorial shows the libvirt NAT bridge, not even the bridge that the tutorial describes creating… If you set the IP address of virbr0, I don’t know what happens.

  • If your VM’s network adapter is connected to the host’s bridge, then you should be able to log into your VM and set a static IP address.

I had a lot of problems getting Network Manager to actually use my ethernet interface as a slave for the bridge. Here’s what worked for me, though:


<span style="color:#323232;">nmcli con show
</span><span style="color:#323232;">nmcli con down </span><span style="color:#183691;">'Wired Connection 1'
</span><span style="color:#323232;">nmcli con modify </span><span style="color:#183691;">'Wired Connection 1'</span><span style="color:#323232;"> connection.autoconnect no
</span><span style="color:#323232;">nmcli con add type bridge con-name br0 ifname br0
</span><span style="color:#323232;">nmcli connection add type bridge-slave ifname enp7s0 master br0
</span><span style="color:#323232;">nmcli con modify br0 connection.autoconnect yes
</span><span style="color:#323232;">nmcli con modify bridge-slave-enp7s0 connection.autoconnect yes
</span><span style="color:#323232;">nmcli con modify br0 ipv4.method manual ipv4.addresses 172.16.0.231/24 bridge.stp no
</span><span style="color:#323232;">sudo systemctl restart NetworkManager.service
</span><span style="color:#323232;">nmcli con show
</span><span style="color:#323232;">ip addr
</span>
  • Instead of enp7s0, you’d use enp1s0 I guess.
  • Above, I manually set my bridge IP address to a static address because my ethernet interface is wired directly to another computer, so no DHCP for me. If you have DHCP on your ethernet network, you probably don’t need to set “ipv4.method” or “ipv4.addresses”.
  • I set “bridge.stp” to “no” because my network doesn’t have any redundant paths, and the stp process seems to take like 25 seconds before I can use the bridge network.

After that, I can go into “Virtual Machine Manger”, set my VM’s NIC’s Network Source to “Bridge device…”, Device name to"br0", boot my VM, login to my VM, configure my VM’s ip address. And then I can connect to the VM’s IP address from the physical ethernet network.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines