'Pinging from virtual machine to raspberry

I have the following setup: A virtual machine, started with qemu is running on an ubuntu laptop. I also have a raspberry pi 4 booted from a sd card connected over ethernet with the laptop. My goal is to establish a network connection between the VM and the Raspberry. So far i worked with a tap (tap0) and a bridge (br0) to connect the VM with my network adapter (eth0). I was expecting that The VM and the raspberry should now be able to ping each other but i can only do the following:

  • Ping from VM to bridge
  • Ping from Raspberry to bridge
  • Ping from bridge to Raspberry or VM

Where could the problem be?



Solution 1:[1]

I found the problem. It was the firewall! Make sure to enable ip forwarding here.

sudo iptables -P FORWARD ACCEPT

if you are in a closed network as in my case this shouldn't be a problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 E_net4 - Krabbe mit Hüten