About I am currently running ubuntu 22.04 running Network Manager: version 1.36
I am looking to share my wifi interface which is connected to the internet with the device connected on eth0 ethernet port of my laptop,
I have used the network manager GUI to configure the eth0 to say share with other computers
. as below
When I connect a raspberry pi to the ethernet port on my laptop, the raspberry pi was given an ip address of 10.42.0.x and I am able to ping my laptop from the pi, But I am unable to reach the internet from pi.
MY setup: internet <----->wlan0_laptop_eth0 <------> eth1_Rasberry pi Note: I would like to share the internet on wlan0 of my laptop with the device connected on ethernet port(eth0) of my laptop.
Issue: If I connect the pi after the laptop is completely booted up, I am unable to reach internet from the pi, pi still got an ip address in the range 10.42.0.x
Current workaround: If I reboot my laptop with pi already connected to the ethernet port of my laptop then somehow I am able to reach internet from my PI
I looked at the ip tables, route, route metrics, I did not see anything out of place, I am happy to provide any logs if needed.
On ubuntu 21.04 I did not have this issue
My issues seems to be the default FORWARD policy is set to drop by the docker daemon,
When I changed the default filter table FORWARD policy to accept, I am able to ping without the need to re-boot by laptop
Fix for the Issue: Change the net.ipv4.ip_forward=1 in /etc/sysctl.conf explicitly, so that docker will not touch the forward policy as stated here. Note: If the file is not edited, docker daemon will set the forward policy to drop.
Root cause: Its not the ubuntu version 22.04 rather its the docker daemon setting the forward policy to drop on start as documented here.