13

My wifi card keeps connecting to a wifi network which is on a channel that prevents me from making a hotspot.

I'm trying to turn the connection off from command line. I have tried a few things:

nmcli radio wifi off

and

ifconfig wlo1 down

Problem with these is that they turn the wifi interface off which also prevents me from creating a hotspot.

What command can I run to keep my wifi interface on but not connected to anything?

Philip Kirkbride
  • 9,816
  • 25
  • 95
  • 167

2 Answers2

21
LANG=C nmcli d
DEVICE  TYPE      STATE      CONNECTION 
wlan0   wifi      connected  connectioname 
eth0    ethernet  unmanaged  --         
lo      loopback  unmanaged  --     

Here you can see the name of the connection as connectionname.

To disconnect, run nmcli con down id connectionname.

Matthias Braun
  • 7,797
  • 7
  • 45
  • 54
1

To Connect/disconnect existing-connected wifi:

nmcli con up "wifi name"; nmcli con down "wifi name";

To Connect/disconnect new wifi:

nmcli device wifi connect "wifi_name" password "password"; nmcli device down "con-name" or nmcli device disconnect "interface_name";

To Create PC hotspot(Lin):

Note:Interface i.e. wifi device not required here since wifi-interface is only used for hotspot also ,con-name must be for future use same hotspot <===============================================================================================================================>

nmcli device wifi hotspot ifname "interface_name" ssid "hotspot_display_name" con-name "any name to use for network" password "your_password"

nmcli device down "con-name" or nmcli device disconnect "interface_name";

to re-activate/deactivate existing hotspot use con-name

nmcli device up "con-name" nmcli device down "con-name"