The Computer Oracle

Determine channel of wireless interface

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Industries in Orbit Looping

--

Chapters
00:00 Determine Channel Of Wireless Interface
00:20 Accepted Answer Score 14
00:32 Answer 2 Score 10
00:45 Answer 3 Score 1
01:19 Answer 4 Score 1
02:23 Thank you

--

Full question
https://superuser.com/questions/485588/d...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #wirelessnetworking

#avk47



ACCEPTED ANSWER

Score 14


OK, I found an answer:

iwlist wlan0 channel

Last line of the output informs about the current channel.




ANSWER 2

Score 10


Because iwlist is deprecated on many systems, you can find the channel using the newer iw as well using iw dev.




ANSWER 3

Score 1


In order to view channels of available wireless interfaces in your locale, you could do:

  1. airmon-ng start and view name of wireless interface eg: wlan0

  2. airmon-ng start wlan0 (To Put Wi-Fi Adapter in Monitor Mode with Airmon-Ng)

  3. airodump-ng mon0 (Capture Traffic with Airodump-Ng)

  4. airmon-ng stop mon0 (To stop Monitor Mode)

There you will see channels of respective wireless interfaces under heading CH .

Besides : values wlan0 and mon0 may differ depending upon your wireless and monitor mode interface as wlp2s0 and wlp2s0mon.




ANSWER 4

Score 1


Using iw

Expanding on confused00's answer and the helpful comment by Gabriel Devillers, iw wlp3s0 info prints the currently used channel among other information:

ifindex 4
wdev 0x1
addr 78:f9:d4:fa:98:0b
type managed
wiphy 0
channel 11 (2462 MHz), width: 20 MHz, center1: 2462 MHz
txpower 20.00 dBm

In this example, wlp3s0 is the name of the network interface.

Alternatively, iw wlp3s0 link shows the frequency in use, 2462 MHz:

Connected to d1:81:cb:6a:36:8c (on wlp3s0)
        SSID: Your_Routers_SSID
        freq: 2462
        RX: 809691 bytes (6101 packets)
        TX: 39608 bytes (313 packets)
        signal: -58 dBm
        rx bitrate: 24.0 MBit/s
        tx bitrate: 72.2 MBit/s MCS 7 short GI

        bss flags:  short-preamble short-slot-time
        dtim period:    3
        beacon int: 100

iw phy gets the supported frequencies:

2412 MHz [1] (20.0 dBm)
2417 MHz [2] (20.0 dBm)
2422 MHz [3] (20.0 dBm)
2427 MHz [4] (20.0 dBm)
2432 MHz [5] (20.0 dBm)
2437 MHz [6] (20.0 dBm)
2442 MHz [7] (20.0 dBm)
2447 MHz [8] (20.0 dBm)
2452 MHz [9] (20.0 dBm)
2457 MHz [10] (20.0 dBm)
2462 MHz [11] (20.0 dBm)
2467 MHz [12] (20.0 dBm)
2472 MHz [13] (20.0 dBm)
2484 MHz [14] (disabled)

To print the hardware capabilities of your network controller and the kernel module it uses, run sudo lspci -vv -s 03:00.0.