How to connect to a specific access point?

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
UNI

How to connect to a specific access point?

Post by UNI »

I have only been using Linux for a few weeks.


[1] Search Before Posting
I have searched, but what I found dealt with connecting to a specific network (with one access point). In my case, I would like to force a connection to a specific access point (AP) when there are many access points (APs) in range and all APs are using the same SSID. I thought that I had figured out how to force a connection to a specific AP by creating/saving multiple Network Connections.

For example:
Network Connection 1 included the BSSID for AP 1
Network Connection 2 included the BSSID for AP 2
...and so on.

Within each saved Network Connection, the option to "Automatically connect to this network when it is available" was turned off (not selected).

When I wanted to connect to a specific AP, I would...
...edit the Network Connection of interest
...select "Automatically connect to this network when it is available"
...save that Network Connection
...disconnect from the current AP
...reconnect to the applicable SSID

After I was finished with the Network Connection of interest, I would edit/save it again with the option to "Automatically connect to this network when it is available" not selected. At any given time, none (or only one) Network Connection would have the option to "Automatically connect to this network when it is available" selected/saved.

This system worked for a few saved Network Connections, but as I added more - something went haywire. The laptop insisted on connecting to an AP other than the one that I had just set to "Automatically connect to this network when it is available". Disabling/enabling Wi-Fi did not help. Disabling/enabling Networking did not help. Restarting the laptop did not help. The AP that the laptop insisted on connection to was insanely far away - with a Signal level of -89 dBm (per iwconfig). Moving to another part of the building, just caused the laptop to pick another undesired, far away AP to connect to.

When I deleted the Network Connection for the AP that the laptop insisted on using, the laptop simply picked another Network Connection to get stuck on - rendering my "force a connection to a specific AP" scheme useless.


There might be better method/scheme for connecting to a specific AP, but my scheme had an additional benefit: When I don't need to connect to a specif AP, I can save all of the Network Connections with the option to "Automatically connect to this network when it is available" selected. Then (in theory) they laptop would connect to the best AP and I could just look at the "Connection Information" screen to see which AP that I was connected to. The title of the saved Network Connection tells me the AP name - instead of having to look up the BSSID and translate that to a specific AP. But alas, the laptop still insisted on connecting to a uselessly far away AP.

As indicated above, the scheme worked until I added more saved Network Connections. I don't recall the exact number of saved Network Connections where the scheme failed, but the total number of APs that I would like to save a Network Connection for is 10.

The "b43" driver limits my download/upload speeds to roughly 10 to 20 Mbps. An external D-Link USB network adapter that I have reaches closer to 50 Mbps on the same network. Perhaps I did something wrong when installing the "b43" driver. Maybe that is contributing to the laptop getting stuck on connecting to one AP.



[2] New Questions Deserve New Topics
Done.



[3] Consider Which Forum Section To Post
I hope that this is the correct Forum Section and sub-section.



[4] Use Informative Titles
I considered...
How to connect to a specific access point when there are more than one using the same SSID?
...but I opted for brevity.



[5] Details! Details! Details!

Code: Select all

System:    Kernel: 4.13.0-41-generic x86_64 (64 bit) Desktop: MATE 1.18.0
           Distro: Linux Mint 18.3 Sylvia
Machine:   System: Dell (portable) product: Vostro 1500
           Mobo: Dell model: 0NX907 Bios: Dell v: A06 date: 04/21/2008
CPU:       Dual core Intel Core2 Duo T5270 (-MCP-) speed/max: 1135/1401 MHz
Graphics:  Card: Intel Mobile GM965/GL960 Integrated Graphics Controller (primary)
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
           Resolution: 1280x800@60.00hz
           GLX Renderer: Mesa DRI Intel 965GM GLX Version: 2.1 Mesa 17.0.7
Network:   Card-1: Broadcom BCM4401-B0 100Base-TX driver: b44
           Card-2: Broadcom BCM4311 802.11b/g WLAN driver: b43-pci-bridge
Drives:    HDD Total Size: 250.1GB (5.3% used)
Info:      Processes: 167 Uptime: 10:52 Memory: 1076.5/3936.1MB
           Client: Shell (bash) inxi: 2.2.35 
See first section for more details on what I would like to accomplish.

After restarting these Open Mesh A60 APs, some of them don't work correctly and must be restarted again. Hence, my desire to force a connection to a specific AP and test its functionality.



[6] Use Default Font Size and Colors
Done.
"Please don't use coloured text"
No colors/colours.



[7] Use Images Sparingly
Shall I use a thousand words instead :-)



[8] Do Not Cross-Post
I won't.



[9] Indicate Solved Topics
If there is a solution to be had. Perhaps another method of forcing a connection to a specif AP will be the solution, but it would be nice to know why my particular scheme failed.



Sorry for the long post, but the "How To Get Help!" post did as for "Details! Details! Details!".

Thanks in advance for your attention to this issue.


edit: typo
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: How to connect to a specific access point?

Post by JerryF »

Welcome!

Details, yes, but TMI.

Connect to the network that you want as the default.

In Network Connections, click on that network, then click on Edit. At BSSID, choose the MAC address from the drop-down list.

That should make it choose the SSID with that MAC address.
UNI

Re: How to connect to a specific access point?

Post by UNI »

Thanks for the reply. Sorry for the TMI.

I understand the steps that you mentioned, but I don't have ten BSSIDs memorized. I was hoping for a solution that did not involve repeatedly looking up the relationship between the BSSID and the English name for the AP. The method that I detailed solved that problem, until it went whacky.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: How to connect to a specific access point?

Post by JerryF »

UNI wrote: Mon May 21, 2018 6:42 pm Thanks for the reply. Sorry for the TMI.

I understand the steps that you mentioned, but I don't have ten BSSIDs memorized. I was hoping for a solution that did not involve repeatedly looking up the relationship between the BSSID and the English name for the AP. The method that I detailed solved that problem, until it went whacky.
You shouldn't have to have them memorized. Save each connection with its BSSID as a connection with a name that makes sense to you for a particular access point.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: How to connect to a specific access point?

Post by JerryF »

Reread your original post. So the main problem is that you keep getting connected to an AP that's not the nearest?

Unfortunately, I don't know enough about this and haven't had that experience.
User avatar
Spearmint2
Level 16
Level 16
Posts: 6900
Joined: Sat May 04, 2013 1:41 pm
Location: Maryland, USA

Re: How to connect to a specific access point?

Post by Spearmint2 »

Have only one wifi device on the computer active at a time. If using the external, turn off the inbuilt. May have to do that in the BIOS.
All things go better with Mint. Mint julep, mint jelly, mint gum, candy mints, pillow mints, peppermint, chocolate mints, spearmint,....
UNI

Re: How to connect to a specific access point?

Post by UNI »

@JerryF,
Thanks again for your time on this.

Since the APs have a problem. I need to connect to each one to test it. For the SSID/network of interest, it looks like I'm going to have to delete each of my saved Network Connections, create one fresh Network Connection, and then use the drop down list in the BSSID field that you mentioned. But it requires looking up the AP's name by its MAC address.

At any given spot in the building, more than one AP should be in useful range. It would be nice if I could stay in one sweet spot and test each AP that is in useful range - then move to the next sweet spot. I should be able to test all ten APs from three sweet spots. Deleting my ten Network Connections for the SSID of interest might cure the issue of connecting to a far away AP. I don't think that that was happening until I started saving multiple Network Connections for one SSID.

Too bad that my method did not work, because it could have solved two issues:
Forcing a connection to a specific AP - when testing the APs.
Easily letting me know which AP that I'm connected to - when not testing the APs.
When not testing the APs, simply looking at the Connection Information screen would have let me know the name of the AP that I was connected to. Of course there are other ways to know which AP that I'm connected to: open a terminal window, use iwconfig to get the AP's MAC address, and then look up the name of the AP based on that MAC address.

I am familiar with batch files in the Windows environment. Is there a way to create one script file per AP such that when I double click on the script file of interest, I'm connected to the desired AP? This is slightly less desirable method - but it solves the issue of having to lookup the relationship between the BSSID and the AP's name. Each script file would have the AP's name in the file name.


@Spearmint2,
There is only one WiFi device active at a time.
edit: thanks for your time too.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: How to connect to a specific access point?

Post by JerryF »

UNI wrote: Tue May 22, 2018 1:39 pm ...
Since the APs have a problem. I need to connect to each one to test it.
...
I'm curious---why do you think that the APs have a problem?

Your situation has been intrigued and I've been experimenting with this.

I noticed that even though I had "Automatically connect to this network when it is available" unchecked for two connections I setup and saved, I also had to uncheck "Connect automatically" under Network Settings. The laptop kept automatically connecting.
Shutter-001.jpg
Shutter-002.jpg
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: How to connect to a specific access point?

Post by JerryF »

So after totally turning off automatic connection, I got this screen from clicking on the tray icon for networks:
Shutter-003.jpg
From here, I would be able to see which AP has the strongest signal and click on it.

These were my setups for AP1 and AP2. The BSSID MAC addresses are made up for security reasons.
Shutter-005.jpg
Shutter-006.jpg
UNI

Re: How to connect to a specific access point?

Post by UNI »

My guess was correct: deleting all ten of the saved Network Connections cured the issue of the laptop automatically connecting to an AP that was too far away.

Your suggestion to use one saved Network Connection and then select the BSSID from the drop down menu worked - like I knew it would - since that is what I had been doing before joining this forum. It just was not convenient when there are ten BSSIDs to pick from.

Thanks for your experimenting!

We might be using different Network Managers (if that is the correct term). I don't see the option named "Network Settings" or an option to "Rescan for wireless networks". And I've not seen a window with just the title of "Network". I cannot post an image of what I do see right now; maybe later.

When I only had three saved Network Connections for the SSID of interest, the laptop did not automatically connect to an AP --- as long as "Automatically connect to this network when it is available" was not selected inside of each of those three saved Network Connections. The weirdness of automatically connecting when I did not want it to only started after saving (5 or 6 or 7?) Network Connections. The bonus weirdness of connecting to an AP that was too far away to be useful started sometime after I already had ten Network Connections saved. I conflated the two weird things to shorten my previous posts.


After I restarting all the APs, some of them do not work. Users can connect to them, but there will be no DNS. When connected to a "bad" AP, pinging 8.8.8.8 works because there is no DNS involved - but nslookup fails to resolve google.com - and of course, surfing to a URL that requires DNS will fail. I'm running beta firmware on these APs to gain access to a feature that I needed, so some issues are to be expected. I think that the "DNS fails after rebooting some APs" issue has been resolved in the latest beta firmware, but I still want to keep checking each AP for a while to be sure.

If I find the time, I'll recreate ten saved Network Connections using my external D-Link USB network adapter. Perhaps the two weird things only happen when the "b43" drivers are in play.
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: How to connect to a specific access point?

Post by JerryF »

I neglected to notice that your DE is MATE---mine is Cinnamon. Sorry about that.

I enjoyed experimenting with this. Thanks for the challenge and the learning experience!

I hope that you can get everything sorted out the way you want it.
UNI

Re: How to connect to a specific access point?

Post by UNI »

I had to time to disable the internal wireless network adapter and use an external (USB) one.

The same weird things happened:
After creating about 4 or 5 Network Connections (each with a specific BSSID saved inside), the laptop connected to an AP that was to far away to be of any use. I deleted all of the saved Network Connections, restarted the laptop, and went back to using one Network connection and the drop down list of BSSIDs. However, once I added the 5th BSSID, that network connection stopped connecting to any AP.

So, is there a way to script a connection or (less desirable) a way to connect to a specific AP via the terminal window.

I had one AP that I could not connect to at all - until I restarted it. That just adds to the confusion of figuring out if the Linux Mint Mate is acting weird or the APs.
UNI

Re: How to connect to a specific access point?

Post by UNI »

Hopefully, it is okay to resurrect my old thread.

I'm still having trouble with Open Mesh Access Points (APs), so I am still looking for a convenient a way to force a connection to a specific AP. The previous posts mention a few ways, but those methods have drawbacks. I was working on an unrelated issue when I noticed something that gave me hope for this "connect to a specific AP" issue.

Look at the sub-menu in this screenshot:
sub-menu.png
Mint Mate's network-manager version 1.2.6-0ubuntu0.16.04.3.

Those Network Connection entries are mostly identical.
(except for connection's name and the DNS IPs or DNS via DHCP):
DNS.png
https://cleanbrowsing.org/filters <<< testing DNS filters for site 1 below

Site 1. One AP. [not Open Mesh}
Network Connection 1, SSID = 2.4 GHz, Google DNS
Network Connection 2, SSID = 2.4 GHz, Family DNS filter
Network Connection 3, SSID = 2.4 GHz, Adult DNS filter
Network Connection 4, SSID = 2.4 GHz, Security DNS filter
Network Connection 5, SSID = 2.4 GHz, DNS via DHCP.
I can be connected to one of those, then select a different one from that sub-menu and Network Manager will disconnect/reconnect in under two seconds. Sweet! I wondered if that same sub-menu might appear if the main difference in the Network Connections was the BSSID.

Site 2. Ten Open Mesh APs.
Network Connection 1, SSID = Guest, has no BSSID specified. It connects to any AP.
Network Connection 2, SSID = Guest, has the BSSID for AP1. The sub-menu appeared! I was excited!
Network Connection 3, SSID = Guest, has the BSSID for AP2. Still only two items in the sub-menu. No longer excited.
Network Connection 4, SSID = Guest, has the BSSID for AP3. It did not appear in the sub-menu either.
Network Connections 5 thru 11 were created for APs 4 thru 10. Still only two items in the sub-menu.

Site 3. Three APs. [not Open Mesh}
Network Connection 1, SSID = TEST, has the BSSID for AP1.
Network Connection 2, SSID = TEST, has the BSSID for AP2.
Network Connection 3, SSID = TEST, has the BSSID for AP3.
No sub-menu at all. Maybe I should have created a Network Connection with no BSSID specified.
Locked

Return to “Networking”