Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Blacklist access points. #170

Open
ghost opened this issue Apr 12, 2019 · 10 comments
Open

[Feature request] Blacklist access points. #170

ghost opened this issue Apr 12, 2019 · 10 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2019

I keep encountering bad access points on Eduroam which have no internet access, and every time my machine switches over to them I have to restart netctl-auto.

It would be nice to have a way to block such "rogue" access points based on BSSID.

@ghost
Copy link
Author

ghost commented Jun 4, 2019

Anyone? PLEASE HELP!

@joukewitteveen
Copy link
Owner

Questions have a better chance of getting an answer in the Arch forums, but let me try to help you.
So you have a profile for Eduroam and some networks with an Eduroam SSID don't work, correct? One thing I can think of is that you list those APs that do work for you and use their BSSIDs in profiles for them. You could keep a general Eduroam profile around and add an ExcludeAuto=yes line to it.

@ghost
Copy link
Author

ghost commented Jun 4, 2019

Thanks, I will try and ask the question there.

The problem with "whitelisting" the BSSIDs which work is, every time you go to a new place (or probably even another part of the same building) you will have to manually add more BSSIDs to the list. And then have to maintain and prune the list as it grows over time.

@joukewitteveen
Copy link
Owner

Let me know when you find a solution! I just found that wpa_supplicant has the ability to blacklist BSSIDs and your use case is a good reason to support such a blacklist. I would be interested in adding support to netctl(-auto). Any suggestions as to how this functionality should be exposed are welcome!

Note: it is currently possible to start netctl-auto and then use wpa_cli -i <interface> blacklist <BSSID> to add BSSIDs to the blacklist. You could put a few of these statements in a script:

#! /bin/bash

for bssid in \
  <BSSID> \
  <BSSID> \
  ... \
  <BSSID> \
; do
    wpa_cli ${1:+-i $1} blacklist $bssid
done

and run this script each time after starting netctl_auto (supply the interface as an argument to the script).

@ghost
Copy link
Author

ghost commented Jun 5, 2019 via email

@joukewitteveen
Copy link
Owner

Have you tried including something like

Security=wpa-configsection
WPAConfigSection=(
    'ssid="eduroam"'
    'key_mgmt=WPA-EAP'
    'eap=PEAP'
    'pairwise=TKIP CCMP'
    'anonymous_identity="anonymous"'
    'identity="<USERNAME>"'
    'password="<PASSWORD>"'
    'bssid_blacklist=<BSSID> <BSSID> ... <BSSID>'
)

in your profile?

@ghost
Copy link
Author

ghost commented Jun 7, 2019

Wow, thanks, according to $ strings '/usr/bin/wpa_supplicant' |grep -i bssid_blacklist it seems to be there. Strange that neither manpages nor my Internet searches had shown it to me. I will definitely give it a try today!

The external-script solution seems to work more or less, and it can be used on the systems whose wpa_supplicant is old and does not include this feature yet, and I improved the script to accept input with comments:
`
#!/bin/sh --

sed -E -e'/^#/d' -e's/#.*//' ${@:?} |while read bssid; do
wpa_cli blacklist "${bssid}"
done
`

@ghost
Copy link
Author

ghost commented Jun 7, 2019

The output of $ wpa_cli blacklist is only Selected interface 'wlp2s0' meaning it does not work somehow?..

@joukewitteveen
Copy link
Owner

It looks like the blacklist you set in the config section does not show up in the output of wpa_cli blacklist. This would be a bug in wpa_cli and (if so) should be reported upstream.

@ghost
Copy link
Author

ghost commented Aug 2, 2019

The setting does have effect, that means wpa_cli is indeed bugged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant