Use nmcli network-manager to manage wifi network

In our daily work, we need to connect the device to wifi, etc. Different vendors provide different ways to configure the network. Take nmcli as an example to illustrate.

(1) Use nmtui to perform network configuration on the command line interface

such as:

连接wifi:nmcli dev wifi connect wifiname password wifipassword

Turn off wifi : nmcli dev disconnect wlan0

           The nmcli command takes effect: nmclicon down wlan0; nmclicon up wlan0

(2) Configuration file: /etc/NetworkManager/NetworkManager.conf

Modify the configuration file to take effect: systemctl restart network or nmcli con reload

          (3) WiFi related

           Scan wifi:  nmcli device wifi

            Turn off/on all wireless network cards :

            nmcli r wifi off
            nmcli r wifi on

            View all connections : nmcli con show

           There are many commands available for nmcli. You can use nmcli -help to view the usage according to specific needs .

In some Linux systems, the default network service is provided by NetworkManager, which is a daemon that dynamically controls and configures the network. It is used to keep current network devices and connections in working condition.

NetworkManager can be used for the following types of connections: Ethernet, VLANS, Bridges, Bonds, Teams, Wi-Fi, mobile boradband (such as mobile 3G) and IP-over-InfiniBand. For these network types, NetworkManager can configure their network aliases, IP addresses, static routes, DNS, VPN connections and many other special parameters.

 NeworkManager is a daemon process for managing and monitoring network settings. A network interface can have multiple connection configurations, but only one connection configuration takes effect at the same time.

Guess you like

Origin blog.csdn.net/Swallow_he/article/details/87628465
Recommended