After Creating a file called wpa_supplicant.conf
Can I set more than 1 network?
https://randomnerdtutorials.com/installing-raspbian-lite-enabling-and-connecting-with-ssh/
country=PT # Your 2-digit country code ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev network={ ssid=”_NETWORK_1″ psk=”PASSWORD”
ssid=”_NETWORK_2″ psk=”PASSWORD”
key_mgmt=WPA-PSK
}
Here’s one way to do it (3 example routers being shown):
1) modify interfaces file at /etc/network/interfaces /etc/network/interfaces.d/interfaces
(note – there will be 2 interfaces files; 1 in /etc/network, the other in /etc/network/interfaces.d — do this for the one in interfaces.d directory )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source-directory /etc/network/interfaces.d
auto lo #lo is loop-back; 127.0.0.1 is always the IP to talk to oneself
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface house inet dhcp
iface backyard inet dhcp
iface Netgear_2.4G inet dhcp
~~~~~~~~~~~~~~~~~~~~
2) modify wpa_supplicant.conf file at /etc/wpa_supplicatn/wpa_supplicant.conf
~~~~~~~~~~~~~~~~~~~
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid=”house_ssid”
psk=”house_passcode”
key_mgmt=WPA-PSK
id_str=”house”
}
network={
ssid=”backyard_ssid”
psk=”backyard_passcode”
key_mgmt=WPA-PSK
id_str=”backyard”
}
network={
ssid=”Netgear_2.4G_ssid”
psk=”Netgear_2.4G_passcode”
key_mgmt=WPA-PSK
id_str=”Netgear_2.4G”
}
~~~~~~~~~~~~~~~~~~~~~~~~~~
oh, and the file /etc/network/interface should basically be empty, except for this:
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
Hi.
Thanks for sharing that solution, Joe.
Does that work for you, wael elsisi?
Regards,
Sara