Page 1 of 1

Internet not working over wifi when eth cable is plugged in. network-manager

Posted: Sun Oct 13, 2019 5:51 am
by KookyFlower
Hello. recently i was setting up my raspberry pi 4 to work with my networks. I have a router that is not connected to the internet which i use for my computers at home as the router that has internet access is too far, and i need cabled connections with my other computers. I connect to the internet using wifi, using the router which has internet access. At first i wasn't able to connect to the internet with the raspberry pi if i plugged the eth cable; the wifi connection was still there, and i could ssh to it over wifi, and could open vnc over wifi, but i couldn't access anything outside the local network.

After hours of searching, i found this ... p?t=196470 and it gave me a solution that worked until i installed networ-manager following these steps ... n-raspbian after installing it, and purging dhcpcd5 and the other packages related to it, i face the same problem, no internet over wifi if eth cable is plugged in.

After more hours of searching for a solution, i've found nothing, so i'm wondering if anyone here happens to know how to fix that. or in case that's not possible for whatever reason, i would like to know how can i go back to the network manager that came as default with the raspberry pi without leaving anything that was done when network-manager was installed so as to not have any trouble later. As a last option, i would do another fresh install but i hope i don't have to do that.

thank you very much!

Re: Internet not working over wifi when eth cable is plugged in. network-manager

Posted: Sun Oct 13, 2019 4:29 pm
by epoch1970
It looks like the router that is not connected to anything unfortunately declares itself as default gateway.
Try to change that in the router by removing the "gateway" information sent to DHCP clients.

If you cannot fix that, you can configure the Pi to use the wifi interface when it looks for non-local destinations.
In /etc/dhcpcd.conf, add:

Code: Select all

interface wlan0
metric 100

to the end of the file.
This will give priority to wifi over ethernet (the opposite of the default setting in dhcpcd) for identical routes. So for Internet destinations (any non-local dest.), instead of using the default gateway on eth0, the Pi will use the gateway on wlan0.

Re: Internet not working over wifi when eth cable is plugged in. network-manager

Posted: Mon Oct 14, 2019 1:06 am
by KookyFlower
Hello, than kyou for the reply!

i don't think i understand what you mean by removing the gateway information sent to dhcp clients, i searched for that, and came across dhcp setting but nothing that mentions removing gateway. could you please explain how that would be done? the internet-less router is an old wrt54gs, i see an advanced routing option that lets me set it up as a router or as a gateway. i've set it as a router, but the behaviour of the raspberry pi when connected to it has not changed.

As for the dhcpcd.conf file, after installing network-manager and purging other packages, that file is gone. is there an equivalent file for network-manager i could modify?

thank you very much!