WPA supplicant

Published 01-01-0001 00:00:00

Setting up a network Wi-Fi on Gentoo or Calculate

Variant for OpenRC

Editing the configuration file: /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

network={ 
ssid="my_ssid" 
psk="my_password" 
}

After configuration below it is a good idea to change the permissions to ensure that WiFi passwords can not be viewed in plaintext by anyone using the computer:

chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf

Editing the configuration file and add the lines: /etc/conf.d/net

modules_wlan0="wpa_supplicant"
config_wlan0="dhcp"

If there is no net.wlan0 in init.d, create:

ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0

Launching a net.wlan0 service

~ # rc-service net.wlan0 start

Adding a net.wlan0 service to startup

~ # rc-update add net.wlan0 default

Or run a script

  • Variant wih wget:
wget -qO- https https://wiki.kronoz.guru/howto/wpa_supplicant/gentoo_wpa_supplicant.sh | bash
  • Variant with curl:
curl -sL https https://wiki.kronoz.guru/howto/wpa_supplicant/gentoo_wpa_supplicant.sh | bash
  • Illustration of this script:
#!/bin/bash

echo "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel" > /etc/wpa_supplicant/wpa_supplicant.conf
echo -e 'network={ \nssid="my_ssid" \npsk="my_password" \n}' >> /etc/wpa_supplicant/wpa_supplicant.conf

chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf

echo 'modules_wlan0="wpa_supplicant"' >> /etc/conf.d/net
echo 'config_wlan0="dhcp"' >> /etc/conf.d/net

ln -s /etc/init.d/net.lo /etc/init.d/net.wlan0
rc-service net.wlan0 start
rc-update add net.wlan0 default