2

I want to change my wireless card to use a specified channel instead of auto.

I've looked around and the way to do it seems to be by running sudo iwconfig wlan0 channel, however I'm getting SET failed on device wlan0 ; Device or resource busy.

I've tried disabling the card through the status bar menu or with sudo ifconfig wlan0 down, but the same thing still happens.

What am I doing wrong and how could I fix it?

karel
  • 122,292
  • 133
  • 301
  • 332
Andrei
  • 120

2 Answers2

3

If you check the mode used by your wireless card, it is probably 'managed:'

wlan0     IEEE 802.11abgn  ESSID:"my_router"  
      Mode:Managed  Frequency:2.462 GHz  Access Point: XX:D7:19:41:54:XX   
      Bit Rate=58.5 Mb/s   Tx-Power=15 dBm   
      Retry short limit:7   RTS thr:off   Fragment thr:off
      Power Management:off
      Link Quality=46/70  Signal level=-64 dBm  

In this context, 'managed' means that the channel, bitrate, etc. are managed by the router. If you wish to change the channel, change it in the administration pages of the router.

chili555
  • 61,330
0

You can put your Wi-Fi adapter into monitor mode, this will disconnect the adapter from your router.

Then change the channel with

iw wlp3s0 set channel 1

or

iw phy0 set channel 1

Here, wlp3s0 is the wireless interface name, get yours with ip a. Similarly, phy0 is the name of the wireless device, consult iw phy for the names on your machine.

To keep an eye on the current channel, use watch iw wlp3s0 info which will produce output like this:

Interface wlp3s0
        ifindex 4
        wdev 0x1
        addr 28:21:96:ad:d5:d5
        type monitor
        wiphy 0
        channel 1 (2412 MHz), width: 20 MHz (no HT), center1: 2412 MHz
        txpower 15.00 dBm

See iw help for the documentation.