Ubuntu 25.04 KVM Bridge Network problems

travm

2[H]4U
Joined
Feb 26, 2016
Messages
2,312
I'm trying to configure a bridge network for VM's. I want the VM to share the physical adapter with the host, and I want both of them to get IP's from the router DHCP server.

I've got everything set-up based on the top answer from this link, except for some changes related to DHCP, as the answer assumes static IP's.
https://askubuntu.com/questions/1412503/setting-up-a-bridge-for-host-and-vm

contents of host-bridge.xml on Host
Code:
<network>
  <name>host-bridge</name>
  <uuid>89ae32dc-af81-4068-935d-f11aeabea5a9</uuid>
  <forward mode='bridge'/>
  <bridge name='br0'/>
</network>

Contents of 50-cloud-init.yaml on Host
Code:
network:
  version: 2
  ethernets:
    enp3s0f0:
      dhcp4: false
  bridges:
    br0:
      dhcp4:  yes
      interfaces:  [ enp3s0f0 ]

ifconfig -a on Host
Code:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.143  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fdd1:93b8:5f1a:0:d438:1dff:fe31:c77  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::d438:1dff:fe31:c77  prefixlen 64  scopeid 0x20<link>
        ether d6:38:1d:31:0c:77  txqueuelen 1000  (Ethernet)
        RX packets 105054  bytes 16627847 (16.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 40977  bytes 56926588 (56.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

bro0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet6 fe80::6499:1fff:fe9a:f3de  prefixlen 64  scopeid 0x20<link>
        ether 66:99:1f:9a:f3:de  txqueuelen 1000  (Ethernet)
        RX packets 35012  bytes 3942046 (3.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27724  bytes 36671479 (36.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 44:1e:a1:55:7e:a4  txqueuelen 1000  (Ethernet)
        RX packets 373442  bytes 205468683 (205.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 265267  bytes 252462287 (252.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0f1: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 44:1e:a1:55:7e:a6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp4s0f0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 44:1e:a1:55:7e:9c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp4s0f1: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 44:1e:a1:55:7e:9e  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 500  bytes 44445 (44.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 500  bytes 44445 (44.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:13:d7:c6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 2 overruns 0  carrier 0  collisions 0

vnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fc54:ff:fe97:8ae5  prefixlen 64  scopeid 0x20<link>
        ether fe:54:00:97:8a:e5  txqueuelen 1000  (Ethernet)
        RX packets 28927  bytes 2458997 (2.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 82263  bytes 114661424 (114.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(i see bro0 is listed here, this is a leftover from a failed previous attempt that included a typo, I'm not sure how to make it disappear, but as far as i can tell nothing uses this)

networkctl on Host
Code:
IDX LINK     TYPE     OPERATIONAL SETUP  
  1 lo       loopback carrier     unmanaged
  2 enp3s0f0 ether    enslaved    configured
  3 enp3s0f1 ether    off         unmanaged
  4 enp4s0f0 ether    off         unmanaged
  5 enp4s0f1 ether    off         unmanaged
  8 vnet1    ether    carrier     unmanaged
  9 bro0     bridge   no-carrier  unmanaged
 10 virbr0   bridge   no-carrier  unmanaged
 11 br0      bridge   routable    configured

brctl show on Host
Code:
bridge name     bridge id               STP enabled     interfaces
br0             8000.d6381d310c77       no              enp3s0f0
bro0            8000.66991f9af3de       no
virbr0          8000.52540013d7c6       yes

sudo virsh net-list --all on Host
Code:
 Name          State    Autostart   Persistent
------------------------------------------------
 default       active   yes         yes
 host-bridge   active   yes         yes

and finally, the code from 'sudo virsh edit <myVMdomainName>' that is related to the network interface, related to the stack exhange answer/guide linked above
Code:
    <interface type='bridge'>
      <mac address='52:54:00:97:8a:e5'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

and for real finally, the output of ifconfig -a on my VM
Code:
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::5054:ff:fe97:8ae5  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:97:8a:e5  txqueuelen 1000  (Ethernet)
        RX packets 15  bytes 1050 (1.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 894  bytes 292084 (292.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 286448  bytes 20339712 (20.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 286448  bytes 20339712 (20.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Also, networkctl output on VM
Code:
IDX LINK   TYPE     OPERATIONAL SETUP     
  1 lo     loopback carrier     unmanaged
  2 enp1s0 ether    degraded    configuring
Any help available here? I know this is a lot - and I'm definitely on a steep learning curve here.

In short, VM is not getting an IP. previously it was "working" with NAT - but that was just giving the VM internet access. I want full network access.
 
Last edited:
Back
Top