Wifi NetworkManager: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
= Managing | = Managing WiFi using NetworkManager = | ||
== Enabling and disabling | == Enabling and disabling WiFi == | ||
To check if | To check if WiFi is enabled by NetworkManager run | ||
# nmcli dev show wlan0 | # nmcli dev show wlan0 | ||
and check the GENERAL.STATE line. If | 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 | To enable WiFi run | ||
# nmcli radio wifi on | # nmcli radio wifi on | ||
Line 16: | Line 16: | ||
# nmcli radio wifi off | # nmcli radio wifi off | ||
== Scanning for available | == Scanning for available WiFi APs == | ||
If | If WiFi is enabled you can get the list of available APs by running | ||
# nmcli dev wifi list | # nmcli dev wifi list | ||
== Connecting to an open | == Connecting to an open WiFi network == | ||
To connect to an open | To connect to an open WiFi network run | ||
# nmcli dev wifi connect <SSID> | # nmcli dev wifi connect <SSID> | ||
To connect to an open hidden | To connect to an open hidden WiFi network run | ||
# nmcli dev wifi connect <SSID> hidden yes | # nmcli dev wifi connect <SSID> hidden yes | ||
Line 34: | Line 34: | ||
# nmcli dev show wlan0 | # nmcli dev show wlan0 | ||
== Connecting to a protected | == Connecting to a protected WiFi network == | ||
To connect to a protected | To connect to a protected WiFi network run | ||
# nmcli dev wifi connect <SSID> password <password> | # nmcli dev wifi connect <SSID> password <password> | ||
To connect to a protected hidden | To connect to a protected hidden WiFi network run | ||
# nmcli dev wifi connect <SSID> password <password> hidden yes | # nmcli dev wifi connect <SSID> password <password> hidden yes | ||
Line 54: | Line 54: | ||
# nmcli con show | # nmcli con show | ||
To disconnect from | To disconnect from WiFi network run | ||
# nmcli con down <SSID> | # nmcli con down <SSID> | ||
To reconnect to | To reconnect to WiFi network run | ||
# nmcli con up <SSID> | # nmcli con up <SSID> | ||
Line 66: | Line 66: | ||
# nmcli con delete <SSID> | # nmcli con delete <SSID> | ||
= Testing | = Testing WiFi throughput = | ||
Establish connection to | Establish connection to WiFi network and use iperf3 tool on target and another host: | ||
iperf3 server (on Target/Host): | iperf3 server (on Target/Host): |
Revision as of 11:41, 19 February 2019
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