5

I changed my adapter to monitor mode using:

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode monitor 

Now, I cannot change it back (in the GUI, when I click on connections, it says that "wireless is disabled by wireless switch"). I have not switched off anything using the hardware buttons.

I tried:

sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode managed 
sudo service network-manager restart

I also tried:

pccardctl eject
pccardctl insert

It appears that it has switched back to managed mode, but is still offline:

ifconfig output:

 eth0      Link encap:Ethernet  HWaddr 00:24:21:6f:84:69  
           inet addr:10.100.1.41  Bcast:10.100.255.255  Mask:255.255.0.0
           inet6 addr: fe80::224:21ff:fe6f:8469/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:27668 errors:0 dropped:0 overruns:0 frame:0
           TX packets:3504 errors:0 dropped:0 overruns:0 carrier:0
           collisions:1 txqueuelen:1000 
           RX bytes:4493143 (4.4 MB)  TX bytes:659945 (659.9 KB)
 
 lo        Link encap:Local Loopback  
           inet addr:127.0.0.1  Mask:255.0.0.0
           inet6 addr: ::1/128 Scope:Host
           UP LOOPBACK RUNNING  MTU:65536  Metric:1
           RX packets:553 errors:0 dropped:0 overruns:0 frame:0
           TX packets:553 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0 
           RX bytes:84110 (84.1 KB)  TX bytes:84110 (84.1 KB)

iwconfig output:

 eth0      no wireless extensions.
 
 lo        no wireless extensions.
 
 wlan0     IEEE 802.11bg  ESSID:off/any  
           Mode:Managed  Access Point: Not-Associated   Tx-Power=off   
           Retry  long limit:7   RTS thr:off   Fragment thr:off
           Power Management:off

5 Answers 5

5

You should execute:

sudo ifconfig wlan0 up

And it should come back to life.

Just to give you a little explanation: the output of the command ifconfig only shows the interfaces that are up. For example, you'll notice that your eth0 interface is up:

eth0       Link encap:Ethernet  HWaddr 00:24:21:6f:84:69  
           inet addr:10.100.1.41  Bcast:10.100.255.255  Mask:255.255.0.0
           inet6 addr: fe80::224:21ff:fe6f:8469/64 Scope:Link
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

Your ifconfig output does not have wlan0 listed, meaning that it has been turned off. If you do ifconfig -a, you should see all interfaces (up or down), and you'll notice that wlan0 won't have UP displayed. And all of this makes complete sense because you switched off your WiFi card when you did ifconfig wlan0 down. So ifconfig wlan0 up should bring it back online. If it doesn't work straight away, do a sudo service network-manager restart.

1
  • 1
    You can also use sudo ip link set dev wlan0 up instead.
    – user677955
    Jul 31, 2019 at 5:46
0

Try using Alpha-Lead's script on GitHub. It provides a nice and easy menu to change modes. https://github.com/Alpha-Lead/ChangeWirelessMode

0

In my case , I need to turn the radio on at the last step.

ip link dev up     
nmcli radio all on 
0

I have tried all the answers provided on the Internet but none of them were working.

Finally, I got my answer and here it is:

sudo su
airmon-ng stop wlan0 && ifconfig wlan0 down && iwconfig wlan0 mode managed && ifconfig wlan0 up && service NetworkManager restart

Here, wlan0 is the network interface name. If yours is different, then change it accordingly.

You must remember to run these commands as super user.

0

With ip and iw

This gets you back to managed mode and establishes a Wi-Fi connection with your wireless router:

ip link set wlp3s0 down
iw wlp3s0 set type managed
ip link set wlp3s0 up
systemctl restart NetworkManager
nmcli con up your_networks_SSID

In this example, wlp3s0 is the name of your Wi-Fi interface.

The key here is to set the interface state to down to avoid iw's error message:

command failed: Device or resource busy (-16)

You must log in to answer this question.

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