0

I am having problems using Wi-Fi to access the internet on my Raspberry Pi when I connect the Pi to my laptop over ethernet.

Wi-Fi works fine and I can access the internet on the Pi when there are no other connections.

I am trying to SSH or VNC into the Pi which is causing the problems. As soon as I connect to the Pi using Ethernet direct to my laptop the internet stops working.

I can VNC or SSH into the Pi over Wi-Fi and the internet works fine via this method.

The pi has the latest Raspbian Stretch Image (2018-06-27). It has also been updated. The only other thing I have done is add a static IP address in /etc/dhcpcd.conf

Does anyone have any ideas or could point me in the right direction. I have found a few threads but they all seem to lead to a dead end.

  • I do not believe you can connect via Ethernet without a crossover cable.Can somebody smarter verify that? – Jan Hus Aug 10 '18 at 3:23
  • 2
    most modern (less than 10 years old) ethernet ports auto-detect such things – Jaromanda X Aug 10 '18 at 5:48
  • What you want is to Prioritize routes to go over wifi rather than over ethernet - raspberrypi.org/forums/viewtopic.php?t=189582 – Jaromanda X Aug 10 '18 at 5:52
  • It is unclear for me what you try. If you only plug in the ethernet cable from your laptop into the RasPi and then connect to the RasPi via WiFi with ssh from another device can you then connect to the internet in the ssh console? Or do you try to get into the internet with your laptop via ethernet cable to the RasPi? Please address me with @Ingo. – Ingo Aug 10 '18 at 8:58
  • Without detail no one can provide an answer! See How to set up networking/WiFi and post details of your network and settings if this does not help. – Milliways Aug 10 '18 at 14:11
0

As per the answer on raspberrypi forum

You could also try the metric parameter. Lowest metric has priority. In /etc/dhcpcd.conf add

interface eth0
metric 300

interface wlan0
metric 200

note: if you use predictable network interface names, the interface names may be something like

enx010203040506

and

wlx010203040506

instead of eth0 and wlan0 respectively (where 010203040506 dpends on the MAC address of the interface) - or a combination! For instance, my Rpi3B uses enx... and wlan0 but by Rpi1B uses enx... and wlx... - and I'm not sure why!

edit: found the reason ... the built in wifi for pi3 and 0W are not "usb devices" therefore are not modified - whereas an external wifi, and the onboard ethernet port on Pi1,pi2 are usb devices

  • Awesome! Thank you for the explanation as to why this occurs on the Pi3. Really helpful. – CBert Aug 11 '18 at 2:23
0

Thank You to JaromandaX for providing the link below that solved the issue. https://www.raspberrypi.org/forums/viewtopic.php?t=189582

The following code prioritized the WiFi to allow the RPi to access the internet (over WiFI) whilst also connected to a laptop via Ethernet.

interface eth0
metric 300
interface wlan0
metric 200

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.