issues accessing internet from a raspberrypi via ethernet

Hi everybody!
I have this setup:
-internet connection from a smartphone acting as hotspot;
-desktop PCs (manjaro gnome 3.34) connected to the smartphone via WIFI;
-a raspberryPI modelB (latest raspbian) connected to a PC via ethernet.

Rpi and PC can see each other in LAN and I can even login via SSH.
When I want to join the internet from RPI through the LANned PCS, I have no access (RPi WIFI is not an option).
I only tried changing dhcpd.conf in RPI and set a basic static profile, eg:

Any advice?
Thank you!

Did you set up your Destop PC to share the internet connection? Do you use a static IP setup between your RPI and your PC, or some kind of DHCP running on your PC.

Make sure your PC can forward IP packages and make sure your set up a NAT between your RPI-PC and PC-Wifi network. You should use different sub nets for each of these networks.

You can find more detailed instructions in the wiki.

Thank you for your reply!
PHONE <-wifi automatic DHCP=fully automatic 192.168.43.x -> PC (Static) <- LAN eth0 static 192.168.123.x -> RPI (DHCPd with static eth0 entry)

According to ARCHwiki:

sysctl net.ipv4.ip_forward=1 --> OK

sudo ip link show
sudo iptables -t nat -A POSTROUTING -o wlp2s0 -j MASQUERADE
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i enp3s0 -o wlp2s0 -j ACCEPT


I get:
ip route show
default via dev wlp2s0 proto dhcp metric 600 dev wlp2s0 proto kernel scope link src metric 600 dev enp3s0 proto kernel scope link src metric 100

Doubt: on PC network manager, as I establish static IP net mask, which gateway address is correct?

Than you!

The following is only for the PC - RPI network.

PC with a static IP ( Sometimes the NetworkManager isn't too happy about static IP setups if it can't detect an up link. This is often the case if the RPI does reboot or is off.)

PC settings:


Do not set up a Gateway, also DNS is not required. It should look like this

Of course you can use if you want.

On the RPI set it up like that


The Gateway needs to be the IP of your PC. Because the RPI need to send all the packages to your PC and your PC needs to recognize that it is the target. The PC does not need a gateway in this PC - RPI network, because it is the target. It will route the packages thru the NAT to the wifi interface. Your PC needs only a Gateway on the PC - Smartphone Network. But this is usually set up by NM with information form the DHCP of your Smartphone.

Thank you, Xabbu.
Rpi goes on throwing this error: temporary failure in name resolution

Just for sake: in rpi > /etc/dhcpcd.conf:
profile eth0
static ip_address=
static router=
static domain_name_servers=

in /etc/dhcpcd.conf (RPI):
changing "profile eth0" to "interface eth0"+reboot
did the magic!
Now internet sharing is active (it is only dead slow, in my case)

Thank you again, Xabbu

This depends on how you set up your DNS. Also I never used DHCP Client to set up a static IP address.
I did not try the last releases of Manjaro ARM, but in the past there were a problem with to many DHCP Clients starting and doing wired things. Simply verify if the correct IP and routes are created on the RPI.

Usually debug somethings like this try to ping first.
All from the RPI

ping  -c 4

then ping the wifi interface address

ping -c 4

then try to ping your Smartphone

ping -c 4

The IP addresses form the network might be wrong. Check if they are correct.

Now you can try to ping a real internet IP

ping -c 4

If that all works, you can check your DNS setup. Do you use systemd-resolved or the good old resovle.conf with something like openresolv?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by