Prevent wlan0 from auto-connecting to any open access point

(reposting from freebsd-wireless@:
https://lists.freebsd.org/pipermail/freebsd-wireless/2017-March/007543.html)

Hi, I have a pretty basic question, but was unable to find any useful
answer in the Handbook or man pages.

I would like to prevent a USB Wifi card from automatically connecting
to an unencrypted network nearby. It happens whenever the card is
plugged to the USB port and the wlan0 interface is brought up. After
a few seconds it's connected to the first unencrypted net it can find.
How could it be stopped?

Thanks for help!

Stefan


freebsd-version:
11.0-RELEASE-p8

rc.conf:
Code:
wlans_urtw0="wlan0"
ifconfig_wlan0="NOAUTO"
ifconfig_urtw0="NOAUTO"

dmesg:
Code:
ugen0.2: <vendor 0x0bda> at usbus0
urtw0: <vendor 0x0bda product 0x8187, class 0/0, rev 2.00/1.00, addr 4> on usbus0
urtw0: unknown RTL8187L type: 0x8000000
urtw0: rtl8187l rf rtl8225u hwrev none
wlan0: Ethernet address: xx:xx:xx:xx:xx:xx
wlan0: link state changed to UP
 
Last edited by a moderator:
… should be rc.conf(5)

Here, with FreeBSD 14.0-CURRENT:

Code:
create_args_wlan0="country GB regdomain etsi"
wlans_iwn0="wlan0"
ifconfig_wlan0="NOAUTO WPA SYNCDHCP"
  • I added NOAUTO today
  • to the best of my recollection, I never found this notebook unexpectedly connected to a non-encrypted wireless network.
(There's a wifi guest service at my place of work, which is secure … rewind a couple of years or so, I vaguely recall people being unexpectedly joined to the service. Don't recall it happening to me, with FreeBSD.)

I'll try to find a non-encrypted network, for a proper test.
 
As far as I remember the installer adds to /etc/wpa_supplicant.conf a section with:
Code:
network={
....
key_mgmt=NONE
}
That's why even if you configure WiFi with "WPA", it still will try to connect to open networks. Just remove/comment out this section as I do.
 
Back
Top