In this article, we will walk you through the process of configuring wpa_supplicant in Ubuntu Server 20.04 for wireless networking. This guide is intended for system administrators and other IT professionals who need to set up a wireless connection on an Ubuntu Server.
To configure wpa_supplicant in Ubuntu Server 20.04 for wireless networking, you can use the netplan network management tool. Simply edit the netplan configuration file, specifying the wireless interface, SSID, and password, and then apply the changes using the netplan commands.
wpa_supplicant is a software application that acts as the supplicant in the Wi-Fi Protected Access (WPA) protocol. It’s used to authenticate wireless networks and manage network connections. In Ubuntu Server 20.04, wpa_supplicant is integrated into the netplan network management tool, which we will use to configure our wireless network.
Checking Your Network Interface
Before we begin, we need to know the name of our wireless interface. You can find this by running the following command:
This command lists all network interfaces on your system. The wireless interface usually starts with ‘wlp’ or ‘wlx’. Make note of this for later use.
Ubuntu Server 20.04 uses netplan as the default network management tool. Netplan reads network configuration from
/etc/netplan/, where you will find a YAML file. The name of this file may vary, but you can check it with the following command:
Let’s assume the file name is “01-netcfg.yaml”. We will use this file to configure our wireless network. Open this file with a text editor, such as nano:
sudo nano /etc/netplan/01-netcfg.yaml
Replace the existing content with the following, making sure to replace “wlx—–” with your wireless interface name, and “network_ssid_name” and “**********” with your network’s SSID and password, respectively:
In this configuration:
version: 2specifies the netplan configuration version.
renderer: networkdtells netplan to use networkd as the backend network renderer.
dhcp6: yesenable DHCP for IPv4 and IPv6, respectively.
access-pointsspecifies the access points that this Wi-Fi device should connect to.
Save the changes and exit the text editor (Ctrl+O, Enter, Ctrl+X).
Applying the Configuration
After editing the netplan configuration file, we need to apply the changes. This can be done with the following commands:
sudo netplan generate
sudo netplan apply
sudo netplan generategenerates the necessary configuration files for the renderer from the netplan configuration file.
sudo netplan applyapplies the configuration, establishing the network connection.
That’s it! You have now configured wpa_supplicant in Ubuntu Server 20.04 for wireless networking. Remember that while we used netplan in this guide, wpa_supplicant can also be configured directly by creating a configuration file at
/etc/wpa_supplicant/wpa_supplicant.conf. However, this is not the recommended approach for Ubuntu Server.
wpa_supplicant is a software application that acts as the supplicant in the Wi-Fi Protected Access (WPA) protocol. It is used to authenticate wireless networks and manage network connections.
You can find the name of your wireless interface by running the command
ip link in the terminal. The wireless interface usually starts with ‘wlp’ or ‘wlx’.
Netplan is the default network management tool in Ubuntu Server 20.04. It reads network configuration from
/etc/netplan/ and allows you to configure network settings using YAML files.
You can open the netplan configuration file using a text editor like nano. Run the command
sudo nano /etc/netplan/01-netcfg.yaml to open the file.
After editing the netplan configuration file, you need to apply the changes by running the commands
sudo netplan generate and
sudo netplan apply in the terminal.
Yes, you can configure wpa_supplicant directly by creating a configuration file at
/etc/wpa_supplicant/wpa_supplicant.conf. However, using netplan is the recommended approach for Ubuntu Server.