Wifi NetworkManager: Difference between revisions

From Variscite Wiki
No edit summary
Line 1: Line 1:
= Managing WIFI using NetworkManager =
= Managing WiFi using NetworkManager =


== Enabling and disabling WIFI ==
== Enabling and disabling WiFi ==


To check if WIFI is enabled by NetworkManager run
To check if WiFi is enabled by NetworkManager run


  # nmcli dev show wlan0
  # 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.
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
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 WIFI APs ==
== Scanning for available WiFi APs ==


If WIFI is enabled you can get the list of available APs by running
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 WIFI network ==
== Connecting to an open WiFi network ==


To connect to an open WIFI network run
To connect to an open WiFi network run
  # nmcli dev wifi connect <SSID>
  # nmcli dev wifi connect <SSID>


To connect to an open hidden WIFI network run
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 WIFI network ==
== Connecting to a protected WiFi network ==


To connect to a protected WIFI network run
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 WIFI network run
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 WIFI network run
To disconnect from WiFi network run
   
   
  # nmcli con down <SSID>
  # nmcli con down <SSID>


To reconnect to WIFI network run
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 WIFI throughput =
= Testing WiFi throughput =


Establish connection to WIFI network and use iperf3 tool on target and another host:
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