Hello there.
I'm trying to run a simple setup with qemu: run several qemu-kvm virtual machines that have a public (DHCP) IP. I.e., I'm not running any NAT in this network.
I'm using Alpine Linux 3.19.1
My current setup is:
I have a "bridge_ext" bridge that I connect my main interface (eth0). My /etc/network/interfaces file content is:
Code:
auto lo
iface lo inet loopback
iface eth0 inet manual
auto bridge_ext
iface bridge_ext inet dhcp
bridge_ports eth0
bridge_stp 0
It works just fine. Then, I create a tap interface for my machine:
Code:
# tunctl -t tap5 -u myself
# brctl addif bridge_ext tap5
# ifconfig tap5 up
And finally, I call qemu:
Code:
$ qemu-system-x86_64 -accel kvm -display vnc=:2 -hda vm.qcow2 -m 2g -netdev tap,ifname=tap5,id=n1,script=no,downscript=no -device e1000,netdev=n1,mac=DE:AD:BE:EF:00:02
At the exact moment I run this command, network is lost in the host with no explanation. But the virtual machine can acquire a new IP by DHCP! After I turn off the virtual machine I still have no access to the network on the host side. I can only access the network after I remove my tap device from the bridge (with brctl) or remove it:
In dmesg, I see stuff like "tap5: entered promiscuous mode". I have no idea if it is related to this problem or not.
Is there something wrong with my setup?
BTW, a very strange thing: even after the tap device (in this example, tap5) is removed from the bridge and deleted, if I create it again and attach it to the bridge, I lost control to the network again. But it doesn't happen if the created tap device was not used by qemu at all. So, right now I have six "unused" tap devices (tap0...tap5) that I cannot use even if I delete and create them again.
Have you ever seen anything like this?
Thank you very much.