wpa_supplicant and moving between static and dhcp networks
You will need to have a 1:1 relationship between a supplicant entry AND a network interface like explained here:
- How to setup multiple WiFi networks?
- Jessie or later - How do I set up networking/WiFi/static IP address?
What I see is that you have a wlan0
interface with dhcp and static at the same time, and that is not going to happen. If you have multiple access points on the same network(essid), and just some of them with a dhcp available you have a problem with your network layout/project, not with Debian neither /etc/network/interfaces
.
Related videos on Youtube
Tychus
Updated on September 18, 2022Comments
-
Tychus over 1 year
I'm trying to make my raspberry pi move between multiple access points, some using DHCP other are static. I read that using
id_str
in your wpa_supplicant networks and having the corresponding configuration in/etc/network/interfaces
can automatically configure the interface but doesn't look like it's the case in my system./etc/network/interfaces :
auto lo iface lo inet loopback auto eth0 allow-hotplug eth0 iface eth0 inet dhcp iface eth0 inet6 auto auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf #iface default inet dhcp iface test inet static address 192.168.0.2 gateway 192.168.0.1 netmask 255.255.255.0
/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="Skynet Defence Network" key_mgmt=WPA-PSK proto=WPA2 psk="illbeback" priority=10 id_str="test" }
with this configuration wpa_supplicant connects to the network but the network settings are not set. am i doing something wrong here ?