14

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?

2 Answers 2

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.

1
  • I think you can omit the id in the command and shorten it to: nmcli con down connectionname Commented Aug 4, 2019 at 9:24
3

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"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .