DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th February 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default how to autoconnect only to hotspots in joinlist?

I have a T400 Thinkpad with OpenBSD 6.4-stable, which is my daily driver and connects to internet over wifi.

Sometimes when I'm at home and boot my laptop, it automatically connects to neighbor's (unsecured) wifi hotspot:

Code:
$ ifconfig athn0
athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
...
         ieee80211: nwid xfinity chan...
I never want the laptop to connect to this hotspot! How do I prevent it from doing so? I want it to only connect using join (not nwid) to one of the hotspots in my /etc/hostname.athn0, which looks like this:

Code:
join homeSweetHome wpakey somePasSword
join AndroidAP wpakey otHerPassWord
join passwordlessCafe
dhcp
Output of ifconfig(8) joinlist confirms that neighbor's hotspot ("xfinity") is not on the list:

Code:
bruno@thinkpad:~355$ ifconfig athn0 joinlist
athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr 00:26:b6:eb:9d:23
        index 2 priority 4 llprio 3
        groups: wlan egress
        media: IEEE802.11 autoselect (OFDM18 mode 11g)
        status: active
        ieee80211: join passwordlessCafe chan 6 bssid 88:f0:77:85:5e:b5 -66dBm
        join: homeSweetHome
              AndroidAP
              passwordlessCafe
        inet 10.1.72.144 netmask 0xffffe000 broadcast 10.1.95.255
I'm very puzzled by this behavior. Any ideas why sometimes I'm automatically connected to neighbor's hotspot? I know having multiple join statements in hostname.if(5) is a new feature. Am I experiencing a bug? If not, how do I tell the system to automatically connect only to the hotspots listed in hostname.if(5)?

P.S. I can't seem to find any mention of a hotspot "blacklist". A workaround would be to disable connection attempts using ifconfig(8)'s "nwid" option, so that ifconfig is forced to use "join".

Last edited by brudan; 28th February 2019 at 07:01 PM.
Reply With Quote
  #2   (View Single Post)  
Old 28th February 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Do you have an empty string anywhere in your join list? If not, then you have an apparent bug which can be reported.

Note that ifconfig(8) is very clear that you can use nwid OR join, but not both.
Reply With Quote
  #3   (View Single Post)  
Old 28th February 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default

Hello again, jggimi. No, no empty strings in my join list (neither in /etc/hostname.athn0 nor in output of ifconfig athn0 joinlist).

Yes, I had noticed that tidbit (either join or nwid but not both). So it seems I found a bug. I'll report it if I have the courage.
Reply With Quote
  #4   (View Single Post)  
Old 1st March 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default

I went ahead and submitted a bug report. One of the developers responded saying that this issue has been fixed in -current and will therefore be fixed in the 6.5 release.

As a workaround for 6.4, one can set a network with "nwid" at the top of /etc/hostname.if, then the join commands. For example:

Code:
nwid hocus wpakey pocus123
join homeSweetHome wpakey somePasSword
join AndroidAP wpakey otHerPassWord
join passwordlessCafe
dhcp
Cheers!
-Bruno

Last edited by brudan; 2nd March 2019 at 07:25 AM.
Reply With Quote
  #5   (View Single Post)  
Old 2nd March 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Reply With Quote
  #6   (View Single Post)  
Old 4th March 2019
beavers beavers is offline
Shell Scout
 
Join Date: Nov 2017
Posts: 85
Default

Quote:
Originally Posted by brudan View Post
As a workaround for 6.4, one can set a network with "nwid" at the top of /etc/hostname.if, then the join commands. For example:

Code:
nwid hocus wpakey pocus123
join homeSweetHome wpakey somePasSword
join AndroidAP wpakey otHerPassWord
join passwordlessCafe
dhcp
Just so I understand, the dev recommended a workaround that exlicitly goes against what ifconfig(8) says? I'm curious if they've only included this workaround in 6.4 only temporarily until the issue is resolved (understanding that it _is_ resolved in -current), or if this will also be included as a new feature when 6.5 is released.
Reply With Quote
  #7   (View Single Post)  
Old 4th March 2019
brudan brudan is offline
Fdisk Soldier
 
Join Date: Dec 2018
Posts: 82
Default

Quote:
Originally Posted by beavers View Post
Just so I understand, the dev recommended a workaround that exlicitly goes against what ifconfig(8) says?
Yes. Follow the thread and you'll see. In fact, it wasn't just any dev--it was phessler@ (the very guy who enabled the multiple join statements in /etc/hostname.if).

Quote:
Originally Posted by beavers View Post
I'm curious if they've only included this workaround in 6.4 only temporarily until the issue is resolved (understanding that it _is_ resolved in -current)
That's correct. phessler@ said the workaround will not be needed in 6.5.

It seems the issue in 6.4 is that ifconfig does not in fact consider joinlist and nwid to be mutually exclusive. Also, in 6.4 it seems that no nwid statement in /etc/hostname.if is equivalent to setting nwid to an empty string (which according to ifconfig(8) man page allows the interface to connect to any available access point). Hence the need for the bogus nwid statement in /etc/hostname.if when using a joinlist.
Reply With Quote
Reply

Tags
blacklist, join, joinlist, nwid, wifi


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
autoconnect to wifi (script) 22decembre OpenBSD General 9 20th January 2015 06:50 PM
Ifconfig and open wifi hotspots woomia OpenBSD General 8 3rd April 2013 12:25 PM


All times are GMT. The time now is 09:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick