Wifi NetworkManager

From Variscite Wiki
Revision as of 12:04, 28 February 2019 by Admin (talk | contribs)
Wireless

Managing WiFi using NetworkManager

Enabling and disabling WiFi

To check if WiFi is enabled by NetworkManager run

# nmcli dev show wlan0

and check the GENERAL.STATE line. If WiFi is enabled, the state is either connected or disconnected. If WiFi is disabled the state is unavailable.

To enable WiFi run

# nmcli radio wifi on

or if you need to disable it you can run

# nmcli radio wifi off

Scanning for available WiFi APs

If WiFi is enabled you can get the list of available APs by running

# nmcli dev wifi list

Connecting to an open WiFi network

To connect to an open WiFi network run

# nmcli dev wifi connect <SSID>

To connect to an open hidden WiFi network run

# nmcli dev wifi connect <SSID> hidden yes

To check connection status run

# nmcli dev show wlan0

Connecting to a protected WiFi network

To connect to a protected WiFi network run

# nmcli dev wifi connect <SSID> password <password>

To connect to a protected hidden WiFi network run

# nmcli dev wifi connect <SSID> password <password> hidden yes

To check connection status run

# nmcli dev show wlan0

Managing existing connections

Once established, the connection is preserved across reboots unless deleted explicitly.

To show existing connections run

# nmcli con show

To disconnect from WiFi network run

# nmcli con down <SSID>

To reconnect to WiFi network run

# nmcli con up <SSID>

To permanently delete connection run

# nmcli con delete <SSID>

Testing WiFi throughput

Establish connection to WiFi network and use iperf3 tool on target and another host:

iperf3 server (on Target/Host):

# iperf3 -s

iperf3 client (on Host/Target):

Run UDP test for 30 seconds
# iperf3 -c <IP_ADDRESS_OF_IPERF_SERVER> -t 30 -u -b 0
Run TCP test for 30 seconds
# iperf3 -c <IP_ADDRESS_OF_IPERF_SERVER> -t 30