QEMU bridge networking not working

Hello
I am running arch linux and a QEMU xubuntu QEMU VM. My VM is not getting an IP address and I don’t know why. Please help :slight_smile: :slight_smile:
I created a bridge
ip link add name dewi_bridge type bridge;
ip link set dewi_bridge up;
ip link set enp7s1 up;
ip link set enp7s1 master dewi_bridge;

DHCP client is running on the bridge
● dhcpcd@dewi_bridge.service - dhcpcd on dewi_bridge

sudo qemu-system-x86_64
-machine accel=kvm
-m 1G
-boot d -cdrom /home/dewi/Downloads/xubuntu-18.04.3-desktop-amd64.iso
-net nic -net bridge,br=dewi_bridge
/var/lib/libvirt/images/slax.qcow2

enp7s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master dewi_bridge state UP mode DEFAULT group default qlen 1000
link/ether 30:b5:c2:02:fb:d7 brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 60 maxmtu 7152

dewi_bridge: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether c6:51:37:9e:22:5a brd ff:ff:ff:ff:ff:ff promiscuity 1 minmtu 68 maxmtu 65535

tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master dewi_bridge state UNKNOWN mode DEFAULT group default qlen 1000

enp7s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master dewi_bridge state forwarding priority 32 cost 4
tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master dewi_bridge state forwarding priority 32 cost 100

default via 192.168.1.1 dev dewi_bridge proto dhcp src 192.168.1.144 metric 205
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.1.0/24 dev dewi_bridge proto dhcp scope link src 192.168.1.144 metric 205

192.168.1.102 dev dewi_bridge lladdr a4:77:33:bc:b4:40 STALE
192.168.1.101 dev dewi_bridge lladdr f4:f5:e8:3c:bc:94 STALE
192.168.1.1 dev dewi_bridge lladdr c4:6e:1f:46:e3:00 REACHABLE
192.168.1.107 dev dewi_bridge lladdr 30:b5:c2:05:4c:09 STALE
192.168.1.103 dev dewi_bridge lladdr 84:a4:66:f7:22:00 STALE
fe80::5cb0:84ff:feaf:922e dev enp7s1 lladdr c4:6e:1f:46:e3:00 router STALE
fe80::5cb0:84ff:feaf:922e dev dewi_bridge lladdr c4:6e:1f:46:e3:00 router STALE

As i understand it (i’m new to it but went through this myself), QEMU+KVM does not do bridge like VMware does.

Your choice is either

  • NAT - your VM will be on a network that is NATed to your host’s address
  • Routed - you can spin up a subnet on your machine for KVM that you will set up a route for on your physical network using your host as its gateway (from your router’s perspective)

thanks.
It turns out the issue is my firewall.
https://wiki.archlinux.org/index.php/QEMU#Bridged_networking_using_qemu-bridge-helper