KVM VM is not getting IPv4 but is getting IPv6 when using DHCP with VLAN bridge on Linux host using network manager
Summary
I am not sure if this is a bug, but I think it is.
I've created a VLAN bridge in networ-manager. My KVM VM uses it, but it does not get a IPv4 address from DHCP. I think it does seem to get an IPv6 IP.
This is my topology:
-
host
connected toswitch
onport 2
-
port 2
hasdefault
and allowsVLAN 20
-
host
has 1 physical etherneteno1
I want it so:
-
host
gets IP ondefault
- some KVM VMs get IP on
default
- some KVM VMs get IP on
VLAN 20
- all VMs should be registered on my switch so other devices on my network can access them
I was able to create the bridge networks in network manager GUI. KVM VMs on the normal bridge get an IP but KVM VMs on the VLAN bridge do not.
I put a bunch of pictures up on https://imgur.com/gallery/VH6t1D6:
- my default eno1 set to not connect automatically
- I created a eno1.20 VLAN and set it to not connect automatically (since we will use in bridge)
- my first bridge; set to connect automatically
- br1 is set to connect automatically
- VM is set to use br1
Version affected
(Which version of NetworkManager is affected (nmcli --version
), which distro, and the version of any other relevant software involved)
# nmcli --version nmcli tool, version 1.42.4 # uname -a Linux desk 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 GNU/Linux # kvm --version QEMU emulator version 7.2.2 (Debian 1:7.2+dfsg-7) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
Steps to reproduce
Explained above.
Actual result
The KVM VM connects to br1
but does not get IPv4 IP from DHCP. It does seem to get an IPv6 IP from DHCP?
Expected result
The KVM should get an IPv4 IP from DHCP.
Relevant logs
I don't know what logs to provide. Everything else with Network Manager seems to be working fine. I'm not getting any errors.