Trying to make disconnect for active connection:

iw dev wlan0 disconnect 

and:

 systemctl stop wpa_supplicant@wlan0.service rm -f /opt/some_app/wpa_supplicant.conf 

There are no error messages, but if you look at using

 iw dev wlan0 info 

information about the interface - ssid has not disappeared anywhere. Moreover, if you use link instead of info , then the output will be the data from the same network, instead of the expected connection . Also, the OS will complain that there is no such file / directory in the system (code: -2).

Tell me what you can do.

  • one
    ip link set dev wlan0 down help? - 0andriy
  • @ 0andriy, thanks a lot, helped! Take it out in response so that you can accept it for the answer) - isnullxbh

1 answer 1

To put the network interface in an inactive state in Linux, you need to run the command

 ip link set dev wlan0 down 

where wlan0 name of the network interface. It works on any network interface, be it Wi-Fi or a regular wired Ethernet network card.