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
  • 110,292
  • 102
  • 269
  • 299
Andrei
  • 120
  • 1
  • 3
  • 8

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
  • 58,968
  • 8
  • 93
  • 129
  • administration pages means ? How to change their ? – manikanta Jun 16 '17 at 06:33
  • @manikanta Log in to the router pages and change the channel. https://www.howtogeek.com/wp-content/uploads/2010/07/image14.png If this is not your router, then you are stuck. – chili555 Jun 16 '17 at 14:31
  • thank you for your reply. I want to do it through commands only. Is it possible ? – manikanta Jun 17 '17 at 04:22
  • The channel is determined by the router, not the computer. Can you telnet into the router and change it there? Possibly, but this is not about Ubuntu. – chili555 Jun 17 '17 at 12:08
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.

Matthias Braun
  • 957
  • 13
  • 19