Configuring the WiFi networks on the Debian 12 desktop operating system is very easy. But, it’s not the case for the Debian 12 server operating system. On Debian 12 server, you won’t have a graphical user interface. So, you have to configure the WiFi network on the Debian 12 server operating system from the command line.
In this article, we will show you how to configure the WiFi on a Debian 12 headless server from the command line.
Topic of Contents:
- Installing the WiFi Network Driver/Firmware on Debian 12
- Installing the WPA Supplicant on Debian 12
- Generating the WPA Passphrase for WiFi SSIDUsing WPA Supplicant
- Finding the WiFi Network Interface Name on Debian 12
- Configuring the WiFi Network on Debian 12
- Restarting the Networking Service on Debian 12
- Checking If the WiFi Is Working on Debian 12
- Conclusion
Installing the WiFi Network Driver/Firmware on Debian 12
Before you can use WiFi on Debian 12, you must install the correct driver/firmware for your WiFi hardware. If you need any assistance in installing the correct driver/firmware for your WiFi hardware on Debian 12, read this article.
Installing the WPA Supplicant on Debian 12
WPA supplicant is used to configure the WiFi networks on the Debian 12 headless server operating system. WPA supplicant is not installed by default on the Debian 12 server. You can easily install it from the official Debian 12 package repository.
First, update the APT package database cache with the following command:
To install the WPA Supplicant on Debian 12, run the following command:
To confirm the installation, press Y and then press <Enter>.
WPA Supplicant is being installed. It takes a few seconds to complete.
WPA Supplicant should be installed on your Debian 12 system at this point.
Generating the WPA Passphrase for WiFi SSID Using WPA Supplicant
Before you can configure the WiFi on your Debian 12 server system to connect to your WiFi network, you have to generate an encrypted WiFi password for the WiFi network that you want to connect to using the WPA supplicant.
To generate an encrypted password for the “Your-WiFi-Name-SSID” WiFi network which has the “very_secret_password” password using the WPA Supplicant, run the following command:
An encrypted password for the “Your-WiFi-Name-SSID” WiFi network should be generated as you can see in the marked section of the following screenshot. Note it:
Finding the WiFi Network Interface Name on Debian 12
To find the WiFi network interface name of your Debian 12 system that you want to configure, run the following command:
In our case, the WiFi network interface name is “wlxa09f10efd9be”. Note the network interface name of your Debian 12 system as you will need it later.
Configuring the WiFi Network on Debian 12
To configure the WiFi network, open the /etc/network/interfaces file with the nano text editor as follows:
Once the /etc/network/interfaces file is opened, add the following lines in the configuration file. Make sure to replace the “wpa-ssid” and “wpa-psk” with your WiFI SSID and encrypted password, respectively.
iface wlxa09f10efd9be inet dhcp
wpa-ssid Your-WiFi-Name-SSID
wpa-psk 812c294d0db35b391a6deb6d0bd169802526f069e914ed1ee26ad8551109cdf2
Once you’re done configuring the WiFi network, press <Ctrl> + X followed by Y and <Enter> to save the /etc/network/interfaces configuration file.
Restarting the Networking Service on Debian 12
For the changes to take effect, restart the networking service of your Debian 12 server with the following command:
Checking If the WiFi Is Working on Debian 12
If you’re successfully connected to your desired WiFi network, the WiFi network interface should have an assigned IP address.
To check whether an IP address is assigned to the WiFi network interface, run the following command:
An IP address should be assigned to your WiF network interface. In our case, the IP address is 192.168.0.113 as you can see in the following screenshot:
Conclusion
In this article, we showed you how to install the WPA supplicant on Debian 12 and generate an encrypted password for your WiFi SSID using the WPA Supplicant. We also showed you how to configure the WiFi on the Debian 12 headless server using the WPA Supplicant.