Use nmcli command to configure WiFi connection (wireless network card configuration)

Use nmcli command to configure WiFi connection (wireless network card configuration)

Currently, major Linux distributions usually use NetworkManager to manage the network, and the corresponding command line tool is nmcli, which can easily configure the network.

Taking Ubuntu 20.04 as an example, the command to create a WiFi connection using nmcli is as follows:

New wifi connect configuration command:

sudo nmcli dev wifi connect huzhenwei password ******** wep-key-type key ifname wlp1s0

Command description:

sudo nmcli dev wifi connect ssid name password WiFi password wep-key-type key ifname wireless network card name

After running the command, you will see a file named "huzhenwei.nmconnection" in the /etc/NetworkManager/system-connections directory

Note: The network connection created by this command takes effect immediately and will not be lost after restarting.

Commands to view the name and status of the wireless network card:

nmcli device

Command to view more configuration parameters of wireless network card:

nmcli dev wifi help

Guess you like

Origin blog.csdn.net/huzhenwei/article/details/106340075