Hi All, I have my RPi3 running Openhabian. Recently I (succesfully) enabled my WIFI thinking this would be a nice ‘back-up’ when I wanted to try something on the Pi and I could easily remove it from the garage where it normally lives to play with it in the livingroom.
When I connect both the LAN and the WIFI the WIFI seems to have priority. Since I want my LAN to have priority (stable connection) I would like to disable the WIFI again. I’m not using it anyhow.
However, I can’t seem to remove the credentials with ‘’‘openhabian-config’’’.
My ultimate goal is a stable system when running in operational mode (thus LAN) but with the flexibility to pick up my Pi and take it to an other location when I’m testing something with my Gpio (thus wifi).
-Initially I only worked with LAN, no problems
-Then I entered my wifi credentials and I could work with wifi. However due to poor signal strength in my default location this sometimes causes problems.
-Currently when I plug in my network cable I still connect via wifi, hence the idea to disable wifi.
It seems like I somehow cometely removed eth0 from my interfaces file.
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Let’s see if I can find out what happened and how to get it back
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
metric 50
allow-hotplug wlan0
iface wlan0 inet manual
metric 100
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Now I can ssh to both my wlan and eth0 connections.
Still strange, I use system items to show my IP address and that shows the WLAN IP.
Marijn, I had the same problem where the wlan0 interface had priority. I found three default routes, one for wlan0 with metric 0, one for eth0 with metric 202, and another one for wlan0 with metric 303. There are a number of posts referencing these three routes but so far I have not figured out where the metric 0 route comes from. I added the following line to rc.local and the wired connection now has precedence. I tested unplugging the eth0 cable - its default route disappeared and traffic switched over to wlan0. When I plugged in the eth0 cable, the eth0 default route reappeared. At least in this situation, the metric 0 default route for wlna0 was not recreated.
route del -net 0.0.0.0 netmask 0.0.0.0 metric 0 dev wlan0
@Marijn_Oudijk, because of the low metric, wlan0 becomes the preferred route for external traffic. My route table also includes specific routes for my local subnet referencing eth0 (metric 202) and wlan0 (metric 303). Even with the third default route, local traffic to other devices on my LAN were using eth0, with external traffic using wlan0.
The right answer is to figure out what adds the second default route referencing wlan0 but deleting it has proven to be an expedient solution.