I have an application running on my RaspberryPi4 that sends sensor data through my Fedora32 laptop, to Ubuntu 18.04 on my VM at Gnome-Boxes. The main host is Fedora 32 laptop. The Raspberry Pi board and my laptop are connected in the same wifi network.
The IP address of my Fedora 32 and the virtual bridge to the Ubuntu VM can be seen with the command ip a
:
3: wlp1s0: ... inet 192.168.2.20/24 brd 192.168.2.255
6: virbr0: ... inet 192.168.122.1/24 brd 192.168.122.255
My Raspberry Pi has the IP address:
3: wlan0: ... inet 192.168.2.21/24 brd 192.168.2.255
The IP of my Ubuntu18.04 VM is:
2: enp1s0: ... inet 192.168.122.253 brd 192.168.122.255
Ping-ing from RaspberryPi to Fedora32 and vice-versa works. Ping-ing from UbuntuVM to Fedora32 and vice versa works too.
I can see a connection from UbuntuVM to RaspberryPi with y@ubuntu:$ ping 192.168.2.21
. However, not from RaspberryPi to the UbuntuVM (y@rapsberry:$ ping 192.168.122.253
).
The application sends data with this network setting: http://192.168.122.253:11311
.
On my Fedora32 I run these commands. But, there is still no connection:
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -d 0.0.0.0/0 -j ACCEPT
firewall-cmd --zone=FedoraWorkstation --add-forward-port=port=11311:proto=tcp:toaddr=192.168.122.253:toport=11311
firewall-cmd --reload
The firewall-cmd --get-default-zone
returns FedoraWorkstation
.
cat /proc/sys/net/ipv4/ip_forward
returns 1.
I tried also the solution with libvirt-hook-qemu from https://superuser.com/questions/1474254/firewall-cmd-add-forward-port-dont-work/1475915#1475915. But also it doesn't work.
The setup connecting the RaspberryPi4 and an Ubuntu18 laptop (wihtout Fedora and its Ubuntu VM) works. Any hint?