TomLO
Posts: 3
Joined: Sun Oct 29, 2017 8:36 pm

Connecting ethernet cable kills the wifi

Sun Oct 29, 2017 8:45 pm

Hi all,

I'm still fairly new to using a Pi and I've hit a bit of a snag, tried searching this forum and googling so if it has come up before and is already solved I do apologise.

I've got RealVNC set up on the Pi and working fine over wifi, however if I connect an ethernet cable to the Pi then I lose the wifi connection until the ethernet cable is unplugged. Just to clarify that the ethernet cable is not connected to my home network just to a separate 4 port switch as I will be using it to connect to an external controller board. Even without anything other than the Pi connected to the switch it still disconnects from RealVNC and wont reconnect until the cable is disconnected.

I have verified that ethernet connection work ok though as if i connect the 4 port switch on the Pi by ethernet cable to my home network I can then connect to the Pi again.

The Pi is configured with a static IP's for both eth0 and wlan0.

Still quite new to both Raspberry Pi and linux in general so not sure what other info will be needed to help with troubleshooting.

Thanks in advance.

Tom

User avatar
B.Goode
Posts: 9038
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Connecting ethernet cable kills the wifi

Sun Oct 29, 2017 9:34 pm

Welcome to the Raspberry Pi forums.

Making an Ethernet connection does not 'kill' your WiFi, it just takes a higher precedence.

I think that behaviour is attributable to a package called hotplug, or ifhotplugd, or similar.

If this is not the behaviour you want it might be possible to reconfigure it or remove the unwanted function.

TomLO
Posts: 3
Joined: Sun Oct 29, 2017 8:36 pm

Re: Connecting ethernet cable kills the wifi

Mon Oct 30, 2017 1:03 pm

Thanks for the reply and for the welcome, sorry my terminology was poor it doesnt kill the wifi as such but drops the current connection.

Basically if I connect an ethernet cable to the Pi then I can only connect via SSH over a wired connection, this only happens if I configure a static IP for eth0. If I remove the entries from /etc/dhcpcd.conf then it works fine however the ethernet connection to the controller board i am attaching to the Pi no longer works presumably as there is no configured IP address/subnet mask.

With a static IP configured I can plug a patch lead between the 4 port switch connected to the Pi and my home network and I can SSH again and the controller board also works fine however this is not a solution as I need to be able to SSH over wlan with eth0 connected to the controller board as the Pi will be located outside.

I have tried researching this problem and not come up with anything, as best I can tell the references to hotplug seem to refer to /etc/network/interfaces which I thought was not used to configure static IP's etc anymore with the configuration now being done in /etc/dhcpcd.conf?

Again I apologise if my terminology is a bit off im still very new to linux.

Thanks

Tom

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Connecting ethernet cable kills the wifi

Mon Oct 30, 2017 1:09 pm

Use the metric parameter in /etc/dhcpcd.conf. Lowest metric value has priority. The ethernet interface has priority by default. This assumes you have different localnets on each interface.

Code: Select all

interface eth0
metric 302
static ip_address=...

interface wlan0
metric 202
static ip_address=...

TomLO
Posts: 3
Joined: Sun Oct 29, 2017 8:36 pm

Re: Connecting ethernet cable kills the wifi

Mon Oct 30, 2017 3:43 pm

Thanks SurferTim.

That solved the problem, now able to use SSH over wlan0 while eth0 is connected to a different network.

sai abhinay
Posts: 1
Joined: Mon Jul 23, 2018 2:33 pm

Re: Connecting ethernet cable kills the wifi

Mon Jul 23, 2018 2:38 pm

Can you explain the steps in detail as I am facing the same problem

hamdanal
Posts: 1
Joined: Tue Jul 31, 2018 1:39 pm

Re: Connecting ethernet cable kills the wifi

Tue Jul 31, 2018 2:00 pm

sai abhinay wrote:
Mon Jul 23, 2018 2:38 pm
Can you explain the steps in detail as I am facing the same problem
Supposing that you already took care of configuring the static IP addresses, all you have to do is editing the file /etc/dhcpcd.conf on your raspberry pi. This could be done by typing

Code: Select all

sudo nano /etc/dhcpcd.conf
in the Pi's terminal, and adding the following lines in the file:

Code: Select all

interface eth0
metric 302

interface wlan0
metric 202
Note that if you already have the line 'interface eth0' (and you probably do) you don't have to add it again, just add 'metric 302' after it. The same goes for the 'interface wlan0'.
After finishing, press Ctrl+x, then Yes, and Enter to exit the editor, and reboot the Pi

Code: Select all

sudo reboot

FabioPD
Posts: 2
Joined: Tue Jul 22, 2014 2:29 pm

Re: Connecting ethernet cable kills the wifi

Tue Jan 14, 2020 8:01 am

I have the same problem , i did the changes to the file above but if I turn off the wifi ON the VNC client will be detached (i think because the IP changes) so I have to use the display on raspberry to access to internet.
How is possible to fix the WLAN IP address to attach at my Raspi via WIFI?
And how to mantain the IP address outside my LAN so i can reache the raspberry from everywhere?

Thank you so much.

Return to “Troubleshooting”