# iwlist scan

## crabigailrose

When you run iwlist scan, does it always order the results according to signal strength? i.e. Cell 01 is the strongest network in range?

----------

## krolden

I doubt it since it is not mentioned in the man page.  You can always check the quality of the connection in the output.

----------

## slackline

Err, you could answer that yourself by looking at the output, here's an example for you to work with...

```

# iwlist scan

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

wmaster0  Interface doesn't support scanning.

wlan0     Scan completed :

          Cell 01 - Address: 00:12:17:2D:63:6C

                    ESSID:"slack"

                    Mode:Master

                    Channel:5

                    Frequency:2.432 GHz (Channel 5)

                    Quality=75/100  Signal level:-57 dBm  Noise level=-70 dBm

                    Encryption key:off

                    IE: Unknown: 0005736C61636B

                    IE: Unknown: 010882848B960C121824

                    IE: Unknown: 030105

                    IE: Unknown: 2A0104

                    IE: Unknown: 32043048606C

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Extra:tsf=00000ca180b6d183

                    Extra: Last beacon: 752ms ago

          Cell 02 - Address: 00:22:3F:CE:CE:A2

                    ESSID:"Technolife"

                    Mode:Master

                    Channel:6

                    Frequency:2.437 GHz (Channel 6)

                    Quality=50/100  Signal level:-82 dBm  Noise level=-70 dBm

                    Encryption key:on

                    IE: Unknown: 000A546563686E6F6C696665

                    IE: Unknown: 010882848B962430486C

                    IE: Unknown: 030106

                    IE: Unknown: 050401030000

                    IE: Unknown: 2A0100

                    IE: Unknown: 2F0100

                    IE: Unknown: 32040C121860

                    IE: Unknown: DD090010180200F0000000

                    IE: WPA Version 1

                        Group Cipher : TKIP

                        Pairwise Ciphers (1) : TKIP

                        Authentication Suites (1) : PSK

                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s

                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s

                              12 Mb/s; 48 Mb/s

                    Extra:tsf=0000005ec41ea183

                    Extra: Last beacon: 1768ms ago

          Cell 03 - Address: 00:C0:02:D4:AA:BA

                    ESSID:"default"

                    Mode:Master

                    Channel:11

                    Frequency:2.462 GHz (Channel 11)

                    Quality=56/100  Signal level:-75 dBm  Noise level=-70 dBm

                    Encryption key:off

                    IE: Unknown: 000764656661756C74

                    IE: Unknown: 010482848B96

                    IE: Unknown: 03010B

                    IE: Unknown: 0406000200000000

                    IE: Unknown: 050400010000

                    IE: Unknown: 2A0100

                    IE: Unknown: 32080C1218243048606C

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Extra:tsf=000000b17189817f

                    Extra: Last beacon: 152ms ago

          Cell 04 - Address: 00:0C:41:36:B5:9C

                    ESSID:""

                    Mode:Master

                    Channel:9

                    Frequency:2.452 GHz (Channel 9)

                    Quality=91/100  Signal level:-41 dBm  Noise level=-70 dBm

                    Encryption key:off

                    IE: Unknown: 00050000000000

                    IE: Unknown: 010882848B962430486C

                    IE: Unknown: 030109

                    IE: Unknown: 050400010000

                    IE: Unknown: 2A0100

                    IE: Unknown: 2F0100

                    IE: Unknown: 32040C121860

                    IE: Unknown: DD06001018020000

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s

                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s

                              12 Mb/s; 48 Mb/s

                    Extra:tsf=0000003a94d38189

                    Extra: Last beacon: 180ms ago

sit0      Interface doesn't support scanning.

ip6tnl0   Interface doesn't support scanning.

```

(The key field to look at is "Quality"   :Wink:  )

----------

## d2_racing

 *crabigailrose wrote:*   

> When you run iwlist scan, does it always order the results according to signal strength? i.e. Cell 01 is the strongest network in range?

 

For what I see, the answer is no  :Razz: 

Cell 04 is pretty strong in that example.

----------

## crabigailrose

Thanks, the only reason I ask is because I am writing a program to automatically connect to the strongest wireless network in range, at my house and everywhere else I test it when I run iwlist scan the cells are in order by strongest quality to weakest, and I was just wondering if that was a coincidence or if it always happened.

----------

