I'm glad it was useful to you! Just for reference I compiled a list of basically every possible configuration for wireless networks there is- that way for people who don't have an ethernet cord can set it up manually without needing to download my script. There are two main methods of configuring wifi-
1. only editing /etc/network/interfaces
2. editing both /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf (your network SSID and password will be added to wpa_supplicant whereas interfaces is edited to reference wpa_supplicant- this way enables you to be connected to multiple networks/ have it automatically reconnect if your router resets for some reason. I much prefer this way.
I could put it all on one code block but to eliminate any doubt, I'll put each full configuration in.
1. /etc/network/interfaces
WPA/WPA2
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "NETWORK_NAME"
wpa-psk "NETWORK_PASSWORD"
WEP
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wireless-essid NETWORK_NAME
wireless-key WEP_KEY
OPEN NETWORK
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wireless-essid NETWORK_NAME
wireless-mode managed
HIDDEN SSID
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "NETWORK_NAME"
wpa-psk "NETWORK_PASSWORD"
wpa-scan-ssid 1
STATIC IP
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
wpa-ssid "NETWORK_NAME" #(set these lines for their respective encryption type- wpa, wep, etc.)
wpa-psk "NETWORK_PASSWORD"
address 192.168.0.110 #(This is the IP you want your raspberry pi to have)
netmask 255.255.255.0 #(This is almost always the same)
gateway 192.168.0.1 #(almost always the same as well. you can verify with netstat -nr)
____________________________________________________________________________________________________________________________________________________________________________________________________
2. WPA SUPPLICANT
/etc/network/interfaces when using wpa_supplicant.conf
wpa-roam (roaming PREFERRED)
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
wpa-conf (non roaming)
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wpa-roam (roaming static IP PREFERRED)
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 192.168.0.110 #(This is the IP you want your raspberry pi to have)
netmask 255.255.255.0 #(This is almost always the same)
gateway 192.168.0.1 #(almost always the same as well. you can verify with netstat -nr)
wpa-conf (non roaming static IP)
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
address 192.168.0.110 #(This is the IP you want your raspberry pi to have)
netmask 255.255.255.0 #(This is almost always the same)
gateway 192.168.0.1 #(almost always the same as well. you can verify with netstat -nr)
/etc/wpa_supplicant/wpa_supplicant.conf
WPA/WPA2
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK_NAME"
psk="NETWORK_PASSWORD"
}
WEP
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK_NAME"
key_mgmt=NONE
wep_tx_keyidx=0 #this forces it to use wep_key0
wep_key0=YOURWEPKEY
}
OPEN NETWORK
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK_NAME"
key_mgmt=NONE
}
HIDDEN SSID
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK_NAME" # it can be any encryption type, just make sure to add the "scan_ssid=1" line after your settings.
key_mgmt=NONE
scan_ssid=1
}