1

Ubuntu 20.04

QEMU macvtap (works)

If I use following network config:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes
      dhcp6: yes

And KVM client network use 'Host device eno1:macvtap', both IPv4, IPv6 works.

tcpdump port 67 or port 68 -i eno1 -nN will show dhcp request, tcpdump on my dhcp server also see the incoming request.

QEMU with host bridge (not work)

However if I use a host bridge network config:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: false
      dhcp6: false
      optional: true
      link-local: []
  bridges:
    br0:
      parameters:
        stp: false
        forward-delay: 0
      interfaces:
        - eno1
      dhcp4: true
      dhcp6: true

And KVM client network use 'Bridge (Host device eno1)', then only IPv6 works, IPv4 cannot get DHCP.

tcpdump port 67 or port 68 -i br0 -nN will show dhcp request, but tcpdump on my dhcp server don't see them.

Only dhcp is not working though. If I set Ipv4 address and route manually, both incoming and out going IPv4 traffic work.


I discover that if I disable docker completely:

sudo systemctl diable docker.service containerd.service
reboot

Then qemu with host bridge will work perfectly.

How can I use qemu with host bridge while running docker?

3
  • have you ever found the solution to this?
    – Mazzy
    Commented Jan 18, 2021 at 18:12
  • @Mazzy No. My KVM usage is limited so I just don't mix them in the same box now.
    – John Siu
    Commented Jan 19, 2021 at 15:51
  • @Mazzy Idid a upgrade to my ubuntu box and kvm and docker working happily together now. Check my answer below.
    – John Siu
    Commented Apr 6, 2021 at 0:56

1 Answer 1

1

After upgrading ubuntu to 20.10, docker and kvm + bridge mode stopped fighting.

I created a br0 in /etc/netplan/01-netcfg.yaml

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: false
      dhcp6: false
  bridges:
    br0:
      interfaces: [eno1]
      dhcp4: true
      dhcp6: true

Created/change KVM client with NIC: "Bridge br0: Host device eno1". Client can now

  • pick up ip4 / ip6
  • kvm client can ssh between each other
  • kvm client can ssh to host
  • host can ssh to kvm client

I am not sure if it is upgrading to 20.10 or removing the extra attribute in 01-netcfg.yaml did the fix, but it is working perfectly now.

1
  • amazing! just make sure to reboot both the host and VM Commented Jun 20, 2022 at 13:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .