Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working on a small project with my Tp-Link MR3040 using barrier breaker.

I am using the command iw wlan0 connect any which will connect to any open WiFi network.

Where I currently live, Time Warner Cable has its open WiFi across town and I don't want my device connecting since it does not provide internet (sites I go to are forbidden 403) is there a way to "blacklist" that ssid?

share|improve this question

1 Answer 1

You can scan, and choose which one to connect to by yourself Get scan results with signal strength and mac using

iw dev wlan0 scan

Parse it in a script and select which one to join manually. iw scan results would contain "RSN:" or "WPA:" or "WEP:" if they are not open. So you can wee out encrypted networks, and select one which is open, maybe with best signal strength "signal: -45.00 dBm".

Since its openwrt you can do it in a Lua script maybe.

buf = output from iw scan
buf = '\n'..buf..'\nBSS'     -- .. is concatenate in lua

Use this regex to match a single block (in Lua or anything else):

"[^A-Za-z%d]BSS"  -- %d is all digits in lua, maybe 0-9 otherwise

Within each block grep SSID, signal, and check if "[^A-Za-z%d]+RSN:", "[^A-Za-z%d]+WPA:", "[^A-Za-z%d]+WEP:" have any match, ignore the blocks which do, and ignore the ones with the SSID in your blacklist.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.