Airmon-ng changes wlan0 to wlan0mon but does not restore

I agree with aircrack-ng 1.2 RC2 from the source in my Ubuntu 15.04 yesterday and try to use it, I ran this command to switch my wlan0 mode to monitoring mode:

sudo airmon-ng start wlan0 

And then my wlan0 will disappear, a new wlan0mon interface will appear. Until this time, it works fine.

But when I finish my work with wlan0mon, I use:

 sudo airmon-ng stop wlan0mon 

to restore my interface, it shows that the command completed successfully. Therefore i try

 ifconfig 

to check my interface, and found that the interface is still called "wlan0mon", so my other script, like creating an AP with Wi-Fi (with hostapd and dnsmasq), no longer works.

Could you tell me how to fix this problem? This is the recovery of the wlan interface name after using airmon-ng.

+6
source share
7 answers

Remove Interface

 iw dev wlan0mon del 

You can recreate the corresponding WLAN device using

 iw phy phy0 interface add wlan0 type managed 

This will create the wlan0 interface.

+8
source

Mine was wlan1mon when in monitor mode: It worked for me

In the terminal, type airmon-ng stop wlan1mon , then press ENTER . When I checked the use of airmon-ng , wlan1mon was still listed, so I retyped the command airmon-ng stop wlan1mon and hit ENTER again. The following check using airmon-ng showed that my card returned to wlan1 . Hope this helps.

+3
source

You can use the following command to remove the interface:

iw dev wlan0mon del

For more information on creating / deleting VIF, see iw help . [Virtual interface]

+1
source

Use these 4 commands:

 iw dev wlan0mon del iw phy phy0 interface add wlan0 type managed sudo iwconfig wlan0 service network-manager restart 

After that, you can use the Internet again.

+1
source

"iw dev mon0 del" prints a big warning not to do this on my system.

The problem here is almost always related to the firmware or driver, and there is little that can be done except to try another adapter. I found that various USB adapters behave differently depending on the hardware capabilities and quality of the Linux driver.

Another thing you can try is to use a dedicated β€œsecure” distribution such as Kali linux. I had much greater success with Wi-Fi monitoring on a wider variety of adapters for Kali linux than other distributions, whether it be a stable or bleeding edge. Thus, the system also plays a role.

0
source

I had the same problem: disable wlan0mon (but on Kali Linux, not Ubuntu), and I believe that my colleague blocked a couple of adapters because of this. However, Colin’s excellent answer of April 14, 2016 in this section fixed the problem on my hardware (ALFA AWUS036NHA) for me without having to enter it twice.

See the following terminal trace:

 root@kali :~# ifconfig -a eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xxx.xx.x.xxx netmask 255.255.254.0 broadcast xxx.xx.x.xxx inet6 xxxx::xxx:xxxx:xxxx:xxx prefixlen 64 scopeid 0x20<link> ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 29180 bytes 2801373 (2.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 301 bytes 30578 (29.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 17 bytes 1009 (1009.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 17 bytes 1009 (1009.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan0mon: flags=867<UP,BROADCAST,NOTRAILERS,RUNNING,PROMISC,ALLMULTI> mtu 1500 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 314530 bytes 70996027 (67.7 MiB) RX errors 0 dropped 307920 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 root@kali :~# airmon-ng stop wlan0mon PHY Interface Driver Chipset phy0 wlan0mon ath9k_htc Atheros Communications, Inc. AR9271 802.11n (mac80211 station mode vif enabled on [phy0]wlan0) (mac80211 monitor mode vif disabled for [phy0]wlan0mon) root@kali :~# ifconfig -a eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xxx.xx.x.xxx netmask 255.255.254.0 broadcast xxx.xx.x.xxx inet6 xxxx::xxx:xxx:xxxx:xxx prefixlen 64 scopeid 0x20<link> ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 44007 bytes 4186533 (3.9 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 368 bytes 36296 (35.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 21 bytes 1249 (1.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 21 bytes 1249 (1.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 root@kali :~# 
0
source

A simpler way would be:

 ifconfig wlan0mon down ifconfig wlan0mon mode monitor ifconfig wlan0mon up 

and then:

  airmon-ng stop wlan0mon 

so now you are back to wlan0 as your main wireless card instead of wlan0mon :)

0
source

All Articles