Skip to main content

Configuring Wireless Network (WiFi)

Navigation bar

This chapter explains how to configure a wireless network (WiFi) on a Linux system.


Install Required Software​

First, install the necessary tools for wireless network configuration:

apt install wireless-tools wpasupplicant
apt install --reinstall wpasupplicant

Configure WiFi Connection​

  1. You might need to manually bring up or down the wireless interface:

    ifup wlan0
    ifdown wlan0
  2. Configure the WiFi password and generate the configuration file:

    wpa_passphrase YOUR_SSID YOUR_PASSWORD > /etc/wpa.conf
    wpa_passphrase ANOTHER_SSID ANOTHER_PASSWORD >> /etc/wpa.conf

    (Replace YOUR_SSID and YOUR_PASSWORD with your actual network credentials.)

  3. Connect to WiFi using the configuration file:

    wpa_supplicant -i wlan0 -c /etc/wpa.conf -B
    dhclient wlan0

Connect to WiFi Automatically at Boot​

Edit the network configuration file to enable automatic connection at boot:

vim /etc/network/interfaces

Add the following lines:

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

After completing the configuration, the system will automatically connect to the specified WiFi network on boot.

AI Translation Notice

This page was translated into English by AI and is provided for reference only. The original document is written in Chinese. If there is any discrepancy, the Chinese version prevails.

本页英文内容由 AI 自动翻译生成,仅供参考;原文为中文,如有差异请以中文原文为准。

查看中文原文 / View the Chinese original →