Difference between revisions of "WiFi"
From Autopilot Wiki
| Line 73: | Line 73: | ||
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | ||
</pre> | </pre> | ||
| + | |||
| + | Interfaces are then launched with <code>ifup</code> and <code>ifdown</code> -- eg. <code>ifup wlan0</code> to open the wifi connection | ||
== References == | == References == | ||
Revision as of 23:45, 14 December 2021
Configuration
When configuring the raspberry pi headless or when using a Lite version without an X server, use wpa_supplicant, configuration file located at /etc/wpa_supplicant/wpa_supplicant.conf, to configure it.
All configurations need preamble like this at the top of the configuration:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US
WEP/Auto
The simplest configuration is something like...
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="NAME OF NETWORK"
psk="PASSWORD"
}
This is the entry that is generated by using raspi-config
WPA
network={
scan_ssid=1
ssid="NAME OF NETWORK"
psk="PASSWORD"
key_mgmt=WPA-PSK
}
WPA2
network={
ssid="NAME OF NETWORK"
psk="PASSWORD"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
Interfaces
If you need a static IP you can use the /etc/network/interfaces file to refer to the wpa_supplicant configuration:
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual address 192.168.1.60 netmask 255.255.255.0 gateway 192.168.1.1 wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Interfaces are then launched with ifup and ifdown -- eg. ifup wlan0 to open the wifi connection
References
... more about "WiFi"