0
I am running the latest November release of Raspian Stretch Lite on my Pi.
I created a /etc/network/interfaces
file with this information whenever I plug in my USB wifi dongle into the USB interface it connects to the appropriate network.
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.0.0.1
gateway 10.0.0.1
network 10.0.0.0
netmask 255.255.255.0
broadcast 10.0.0.255
auto wlan0
iface wlan0 inet static
address 10.10.10.1
gateway 10.10.10.1
network 10.10.10.0
netmask 255.255.255.0
broadcast 10.10.10.255
auto wlan1
iface wlan1 inet dhcp
wpa-ssid "ssidssidssid"
wpa-psk "pskpskpsk"
However, I need to be able to connect successfully to multiple networks, so doing a little research led me to how do i set up networking wifi static ip address
This one talks about leaving /etc/network/interfaces
file alone, and making changes to only /etc/wpa_supplicant/wpa_supplicant.conf
or /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
for stretch.
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
scan_ssid=1
ssid="ssid1ssid1ssid1"
psk="psk1psk1psk1"
id_str="AP1"
}
network={
scan_ssid=1
ssid="ssid2ssid2ssid2"
psk="psk2psk2psk2"
id_str="AP2"
}
I had to sudo systemctl enable wpa_supplicant
to enable wpa_supplicant and sudo systemctl start wpa_supplicant
since it was showing disabled on my build.
I have even tried rebooting after enabling this service. But I am not showing an IP address from the access point using ip address
. Using iwgetid
gets me nothing and iwconfig
doesn't show it connecting either.