Difference between revisions of "WiFi"
m (Jonny moved page WiFi with wpa supplicant to WiFi) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:RaspiOS]] | [[Category:RaspiOS]] | ||
[[Category:Networking]] | [[Category:Networking]] | ||
+ | [[Category:Configuration]] | ||
== Configuration == | == Configuration == | ||
When configuring the raspberry pi headless or when using a Lite version without an X server, use [[Uses Unix Library::wpa_supplicant]], configuration file located at <code>/etc/wpa_supplicant/wpa_supplicant.conf</code>, to configure it. | When configuring the raspberry pi headless or when using a Lite version without an X server, use [[Uses Unix Library::wpa_supplicant]], configuration file located at <code>/etc/wpa_supplicant/wpa_supplicant.conf</code>, to configure it. | ||
+ | |||
+ | '''Note:''' you can also create the <code>wpa_supplicant.conf</code> file in the /boot directory of a freshly flashed disk image to configure the raspi headlessly, eg. without needing to attach a keyboard/monitor to it. | ||
All configurations need preamble like this at the top of the configuration: | All configurations need preamble like this at the top of the configuration: | ||
Line 78: | Line 81: | ||
== References == | == References == | ||
− | * https://forums.raspberrypi.com/viewtopic.php?f=28&t=50312 | + | * [[Cites URL::https://forums.raspberrypi.com/viewtopic.php?f=28&t=50312]] |
− | * https://coderwall.com/p/v290ta/raspberry-pi-wifi-setup-with-wpa2-psk-aes | + | * [[Cites URL::https://coderwall.com/p/v290ta/raspberry-pi-wifi-setup-with-wpa2-psk-aes]] |
+ | * [[Cites URL::https://www.raspberrypi.com/documentation/computers/configuration.html#adding-the-network-details-to-your-raspberry-pi]] - See also for encrypting stored passkeys |
Latest revision as of 23:18, 28 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.
Note: you can also create the wpa_supplicant.conf
file in the /boot directory of a freshly flashed disk image to configure the raspi headlessly, eg. without needing to attach a keyboard/monitor to 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