Configure wifi on linux using wpa_supplicant


Linux
#networking#linux#lightweight

Steps for setting up wifi using wpa supplicant

Step 1: Find your Wi-Fi interface name. It's most likely wlan0.
ip link


Step 2: Generate the configuration file. You will need your extact SSID(Wifi Network name) and the wifi password.
sudo wpa_passphrase "YOUR_SSID" "YOUR_PASSWORD" | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf


Step 3: Configure your network interfaces file
sudo nano /etc/network/interfaces


Add the following text to the interfaces text file:

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


Step 4: Bring the interface up
sudo ifup wlan0