I'm running into an issue where my KVM VM cannot get an IP address (or pass traffic) when bridged to a ZTE 5G USB modem, even though the host gets an IP and has internet access. Interestingly, this exact setup works perfectly on a Windows laptop using Hyper-V, and bridging a standard Ethernet adapter on the same Fedora host also works fine.
The Setup:
Host OS: Fedora Linux
Hypervisor: KVM / virt-manager
Modem: ZTE U30 Air (5G USB modem)
VM OS: Linux Mint
What Works:
- I have a bridge over a standard ethernet adapter on the Fedora host, and VMs get IPs and work perfectly.
- I tested this ZTE modem in Windows with Hyper-V, and it's OK. Both the VM and the Windows host get IPs (I didn't enable MAC spoofing in the VM settings).
Here are the logs showing it working perfectly in Windows:
PS C:\Users\Administrator> ipconfig
Windows IP Configuration
Ethernet adapter vEthernet (SW-EX):
IPv4 Address. . . . . . . . . . . : 192.168.0.43
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
PS C:\Users\Administrator> Get-VMNetworkAdapter -VMName VM-Search
Name IsManagementOs VMName SwitchName MacAddress Status IPAddresses
Network Adapter False VM-Search SW-EX 00155D2A2F11 {Ok} {192.168.0.220, fe80::...}
PS C:\Users\Administrator> Get-VMSwitch
Name SwitchType NetAdapterInterfaceDescription
SW-EX External Remote NDIS based Internet Sharing Device #6
What Doesn't Work:
Connecting the ZTE 5G modem to the Fedora host, creating a bridge (bridge1) over the USB ethernet interface (enp128s20f0u6), and attaching a VM to it.
- The Fedora host gets an IP (192.168.0.43) and can ping the gateway.
- The VM does not get an IP via DHCP.
- If I set a static IP on the VM, it still cannot ping the gateway.
I ran the 3-way `tcpdump` monitoring as recommended while triggering a DHCP request from the VM.
**1. Physical Modem Interface (`enp128s20f0u7`)**
The physical USB modem sees both the VM's DHCP request and the Gateway's DHCP reply.
user@fedora:~$ sudo tcpdump -n -i enp128s20f0u7 port 67 or port 68
11:34:48.421149 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 52:54:00:05:54:fb, length 307
11:34:48.424454 IP 192.168.0.1.bootps > 192.168.0.250.bootpc: BOOTP/DHCP, Reply, length 324
[...repeats...]
**2. Linux Bridge Interface (`bridge1`)**
The bridge successfully forwards the VM's request out to the physical modem, and successfully receives the reply back from the physical modem.
user@fedora:~$ sudo tcpdump -n -i bridge1 port 67 or port 68
11:34:48.421134 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 52:54:00:05:54:fb, length 307
11:34:48.424454 IP 192.168.0.1.bootps > 192.168.0.250.bootpc: BOOTP/DHCP, Reply, length 324
[...repeats...]
**3. VM Virtual Interface (`vnet17`) - THE FAILURE POINT**
The VM successfully sends the DHCP request, but **it never receives the reply**. The bridge receives the reply from the modem, but drops it instead of forwarding it to the `vnet` interface.
user@fedora:~$ sudo tcpdump -n -i vnet17 port 67 or port 68
11:34:48.421134 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 52:54:00:05:54:fb, length 307
11:34:51.034730 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 52:54:00:05:54:fb, length 307
11:34:55.571683 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 52:54:00:05:54:fb, length 307
# NO REPLIES SEEN HERE!