Skip to content

Instantly share code, notes, and snippets.

@egin10
Created January 7, 2020 08:37
Show Gist options
  • Save egin10/ee4cce82d082f471d598cb89561d15e4 to your computer and use it in GitHub Desktop.
Save egin10/ee4cce82d082f471d598cb89561d15e4 to your computer and use it in GitHub Desktop.
automatically connect a raspberry pi to a wifi network
# /etc/network/interfaces
auto wlan0
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet dhcp
#iface wlan0 inet static
#address 192.168.1.155
#netmask 255.255.255.0
#gateway 192.168.1.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
# /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="YOUR_NETWORK_NAME"
psk="YOUR_NETWORK_PASSWORD"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
#proto could be either RSN (WPA2) or WPA (WPA1).
#key_mgmt could be either WPA-PSK (most probably) or WPA-EAP (enterprise networks)
#pairwise could be either CCMP (WPA2) or TKIP (WPA1)
#auth_alg is most probably OPEN, other options are LEAP and SHARED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment