I'm trying to achieve two things, but they seem to be contradictory:
- I want to set a static ip on
eth0
to be able to SSH into it from my Windows 10 Laptop via Ethernet cable. (I take my Rpi on the go, and I may not have network or be on an SSID which the Pi doesn't know) - for wlan0 - I'd like the Pi to simply use DHCP from w/e router it's connected to. Ideally at the same time eth0 should still have the static ip so I can ssh in if wlan0 has problems.
from what I've read this can be done via /etc/dhcpcd.conf
or /ect/network/interfaces
, with the latter being deprecated and dhcpcd generally favored- so I'm trying to get dhcpcd to work.
Setting eth0 static ip works:
interface eth0
static ip_address 192.254.1.100
But then ifconfig shows wlan0 also uses 192.254.1.100 (which isn't in the router's subnet, so no network connection either)
I've tried setting
interface wlan0
dhcp
But that doesnt fix it. Setting a static ip:
wlan0
static ip_address 1.2.3.4
will set a different static ip for wlan0, but that doesn't solve my problem. Using specific ssids instead of wlan0 has the same effect.
If having static ethernet+dhcp wifi is a problem I could settle for some easy way to ssh into the pi with ethernet, but hostname didnt work for me so far.
Doesn't seem like it should be this hard to configure though, I'm new to this so hoping I'm just missing something simple :)
Raspberry Pi 3B with Buster
man dhcpcd.conf
? – Seamus Nov 21 '20 at 00:31request 192.254...
instead ofstatic ip_address 192.254....
but for some reason the pi doesn't get the address (there's nothing else on the network with the ip I requested).@Seamus yes, I may have missed something as I'm a networking newbie, what I found that seemed relevant was mainly
– Jonathan Levin Nov 21 '20 at 00:58request
,static ip_address
anddhcp
. I had no luck with these.