User Tools

Site Tools

Return to Home page


To scan all availlable IEEE 802.11 wireless networks:

iwlist <interface> scanning

To connect the interface with name <interface> with the wireless network with name <wlan_name>:

iwconfig <interface> essid <wlan_name>

Configure a WiFi interface in monitor mode

sudo iw wlan0 interface add moni0 type monitor
sudo ifconfig moni0 up

where wlan0 is the name of the interface. moni0 is the name of the interface that receives all the packets of the wireless network. The wireshark program can be used through the moni0 interface to sniff wireless packets.

Useful link regarding the ath10k driver:

Some useful options


To block the transmission rate to a given speed use the bitrates option of the iw command.


# Block the rate to 54Mb/s in 5Ghz band
iw dev wlan0 set bitrates legacy-5 54

Configure two WiFi interfaces in Ad-hoc mode

Let wlan0 and wlan1 be two WiFi networks interfaces, in the same PC or in different PCs. In order to built an Ad-hoc network between these two interfaces,execute the following shell commands:

# Put down the network interface
sudo ifconfig wlan0 down
# Configure the interface in ad-hoc mode
sudo iwconfig wlan0 mode ad-hoc
# Configure the transmission and reception channel (for instance channel 1)
sudo iwconfig wlan0 channel 48
# Give a name to the WiFi network (for instance xyz)
sudo iwconfig wlan0 essid "xyz"
# Put up the network interface
sudo ifconfig wlan0 up
# Eventually provide an address to the network interface (for instance with netmask
sudo ifconfig wlan0 netmask
# Do the same with the second network interface (wlan1)
sudo ifconfig wlan1 down
sudo iwconfig wlan1 mode ad-hoc
sudo iwconfig wlan1 channel 48
sudo iwconfig wlan1 essid "xyz"
sudo ifconfig wlan1 up
sudo ifconfig wlan1 netmask

Connect to a WPA/WPA2 WiFi network

Use the following command to save the passphrase:

wpa_passphrase ch1 >> /etc/wpa_supplicant.conf

In the command ch1 is the SSID of the Wi-Fi network, while mypassphrase is the relevant passphrase to connect to the ch1 network.

The actual connection can be performed with the following command:

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

where wlan0 is the name of the interface, while the option -B runs the wpa_supplicant utility in background.

An useful link:

Blocked wireless card

In the case the following error is printed into the screen:

SIOCSIFFLAGS: Operation not possible due to RF-kill

probably your wireless network card is soft blocked.

Do the following steps:

  1. Check if the network card is soft blocked. You can see the command and the possible output:
> sudo rfkill list
0: phy0: Wireless LAN
	Soft blocked: yes
	Hard blocked: no
  1. Unblock all the network cards:
sudo rfkill unblock wifi; sudo rfkill unblock all
  1. Check again the state of the network card in order to know if it has been unblocked:
> sudo rfkill list
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

Disable Network Manager

To disable the Linux Network Manager service type the following commands:

sudo nmcli radio wifi off
sudo rfkill unblock all

Other informations on how to disable network manager can be found here:

If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at]

You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url:
/web/htdocs/ · Last modified: 2024/04/08 22:35 by

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki
Privacy Policy