1

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.

Greenonline
  • 2,969
  • 5
  • 27
  • 38
CBert
  • 13
  • 4

2 Answers2

1

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

Jaromanda X
  • 2,481
  • 1
  • 15
  • 15
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
CBert
  • 13
  • 4