Connecting to a Wi-Fi network (Station mode)

Updated: April 19, 2023

For the general case of connecting to a Wi-Fi network, we recommend that you use the wpa_supplicant daemon.

It handles unsecure, WEP, WPA, WPA2, and if you have the right drivers, WPA3 networks, and provides a mechanism for saving network information in a configuration file that's scanned on startup. This removes the need for you to constantly reenter network parameters after rebooting or moving from one network domain to another.

You can connect to a Wi-Fi network by using one of the following:

Once connected, you need to configure the interface in the standard way, which is TCP/IP configuration in a Wi-Fi network (i.e., client in infrastructure mode, or ad hoc mode).