I am failing to connect to open wifi networks using wpa_cli. I am trying to connect to the open wifi networks in the following way:

$ sudo wpa_cli -i wlp3s0
> add_network
> set_network 0 ssid "Guest"
> enable_network 0

When I try to enable the network sometimes it just replies OK and then nothing. Few times, I have seen it to reply following:


wpa_cli is working without any issue for password protected networks.


Usually to connect to a network requires to use some authentication mechanism. This is handled among other settings by wpa_supplicant's key_mgmt variable:

# key_mgmt: list of accepted authenticated key management protocols
# WPA-PSK = WPA pre-shared key (this requires 'psk' field)
# WPA-EAP = WPA using EAP authentication
# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically
# generated WEP keys
# NONE = WPA is not used; plaintext or static WEP could be used
# If not set, this defaults to: WPA-PSK WPA-EAP

Connecting to an open SSID means not using any authentication nor cipher: the parameter has to be changed from default to NONE as written above (plaintext case).

This value can be set dynamically through the wpa_cli command before enabling (the use) of the network as many other values:

> help set_network
  set_network <network id> <variable> <value> = set network variables (shows
    list of variables when run without arguments)

This command should be inserted before enable_network:

set_network 0 key_mgmt NONE

An example run could look like this:

# wpa_cli -i wlp3s0
wpa_cli v2.9
Interactive mode

> add_network
> set_network 0 ssid "Guest"
> set_network 0 key_mgmt NONE
> enable_network 0
<3>SME: Trying to authenticate with 12:34:56:78:9a:bc (SSID='Guest' freq=2437 MHz)
<3>Trying to associate with 12:34:56:78:9a:bc (SSID='Guest' freq=2437 MHz)
<3>Associated with 12:34:56:78:9a:bc
<3>CTRL-EVENT-CONNECTED - Connection to 12:34:56:78:9a:bc completed [id=0 id_str=]
  • I was expecting some kind of key management. Didn't know how to do it. help command in the interactive mode or man wpa_cli didn't help. Thank you so much. It is working now. Aug 18 '21 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.