How to Put WiFi Interface into Monitor Mode in Linux? - GeeksforGeeks

09 Apr, 2021
Before discussing what is Monitor mode and how do we change our WiFi mode into monitor mode from managed let’s discuss that how to establish a connection to WiFi. So, at first, our system sends the packet to the WiFi and WiFi receives those packets and sends us the acknowledgment and with this process, our connection gets established with the WiFi, and if we want to communicate with another device in the network then the WiFi sends those packets to that system.
 It is a mode in which the packets that every system sends to the WiFi are received by the system which is having the Monitor mode of WiFi instead of the WiFi itself. It means that all data is passed through the device which has the monitor mode of the WiFi.
The ways to do this are listed below:
Using Iw.
Using iwconfig.
Using airmon-ng.
Method 1. Using iw: First, check the interface of the WiFi by using the command:
sudo iw dev
Output:
As you can see clearly from the output the WiFi interface is “wlp1s0”. After knowing the interface of the WiFi what we have to do is that down the WiFi interface then change its mode from managed to monitor and then up the WiFi. The commands used to do this task are
sudo ip link set wlp1s0 down
sudo iw wlp1s0 set monitor none
sudo ip link set wlp1s0 up
Now to check the status of the WiFi again run the first command:
sudo iw dev
Output: 
Once your task is done don’t forget to put WiFi into Managed mode:
sudo ip link set wlp1s0 down
sudo iw wlp1s0 set type managed
sudo ip link set wlp1s0 up
Now to check the status of the WiFi again run the first command:
sudo iw dev
Output:
Method 2. Using iwconfig: Again check the interface of the WiFi but this time with a different command.
sudo iwconfig
Output: 
We have to do the same task we did in the first method i.e. down the WiFi interface, change its mode, and then up the interface but this time with different commands:
sudo ifconfig wlp1s0 down
sudo iwconfig wlp1s0 mode monitor
sudo ifconfig wlp1s0 up
Now check the WiFi status:
sudo iwconfig
Output:
Put wifi in managed mode:
sudo ifconfig wlp1s0 down
sudo iwconfig wlp1s0 mode managed
sudo ifconfig wlp1s0 up
Now to check the status of the WiFi again run the first command:
sudo iwconfig
Output:
Method 3. Using airmon-ng:
First, you need to install aircrack-ng using the command:
sudo apt-get install aircrack-ng
Output:
Once again check the interface of the WiFi but this time with a different command.
sudo airmon-ng
Output:
The next step is to check the interfering processes by using the following command:
sudo airmon-ng check
Output:
Now we have to kill these processes by using the command:
sudo airmon-ng check kill
Output:
To put the interface into Monitor mode run the command:
sudo airmon-ng start wlp1s0
Output:
Now a new interface is created let’s check it using the command:
iwconfig
Output:
Now we need to return to the original interface by using the following command:
sudo airmon-ng stop wlp1s0mon
Output:
Check the interface by using the command:
iwconfig
Output:
How To
Linux-Unix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to Install FFmpeg on Windows?
How to Set Git Username and Password in GitBash?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Install Jupyter Notebook on MacOS?
How to Create and Setup Spring Boot Project in Eclipse IDE?
Sed Command in Linux/Unix with examples
AWK command in Unix/Linux with examples
grep command in Unix/Linux
cut command in Linux with examples
TCP Server-Client implementation in C