Thumbnail: linux

Connecting to a specific BSSID on Linux

by on under technical
2 minute read
Image: wifi.jpg

Problem

In environments like a university or a company where you have multiple wireless stations under the same name, it is sometimes difficult to have a stabile and fast connection, because your operating system will usually try to connect to the closest and the strongest signal avaliable. If there are many devices connecting to the same router, it will decrese the stability and performance for various reasons that I don’t wanna go into details in this article. I also use this following solution to connect 5GHz stations, if my computer tends to connect to the 2.4GHz stations automatically.

Solution

It is possible to list every available wlan station under the same name and check their quality or frequency by iwlist command. It only requires the id of the wlan device used to connect to the wlan in following format:

iwlist wlo1 scanning

This command will list every available station in the range of your device, so It is better to filter the results to make it easier to find out which BSSID to connect. For the filtering, using grep is one of the possible solutions:

iwlist wlo1 scanning | grep -C5 eduroam

In this example I tried to filter stations for the wlan named eduroam

Result of the command

          Cell 02 - Address: 00:**:3E:**:D8:**
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=35/70  Signal level=-75 dBm  
                    Encryption key:on
                    ESSID:"eduroam"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=00000000188d941f
--
          Cell 07 - Address: **:26:**:F7:93:00
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=21/70  Signal level=-89 dBm  
                    Encryption key:on
                    ESSID:"eduroam"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000006a1bb5cf
                    ...

From the resulting list, we only need to copy the Address of station we want to connect and paste it to the BSSID field of Identity tab inside properties of connection:

alt text

linux, ubuntu, wifi, hardware
comments powered by Disqus