3

I frequently travel by buses, most of which have some sort of WiFi onboard. The usual way to connect to them with an automagical connection manager like Wicd is to select the network and then, upon launching the browser some additional authentication takes place and I'm done. But OpenBSD has no such manager, so I came to use and like the standard ifconfig method. In the standard case, where I have e.g. WEP2 encryption and password authentication, the way to go about it is to first run:

ifconfig iwn0 nwid <network_id> wpakey <password>

and after that:

dhclient iwn0

The question is how to connect in the bus case, where there's no password? So far I tried several things like not specifying the password at all or giving an empty password (rejected immediately), but all of them resulted in output like this:

iwn0: no link ............. sleeping

upon running dhclient.

Wojciech Gac
  • 1,538
  • 1
  • 16
  • 30

1 Answers1

2

I dug deeper into the man pages (ifconfig(8)) and found out the following way. I first issue:

ifconfig iwn0 nwid <network_id> -wpa

according to the following excerpt form the manpage:

-wpa    Disable Wi-Fi Protected Access.

I then issue:

dhclient iwn0

And after loading any website (and going through the authentication) I have the connection established.

Wojciech Gac
  • 1,538
  • 1
  • 16
  • 30
  • If you have configured your interface with wpa (let's say that you are at home where you use it) when you move to an unprotected network you have to issue -wpa. If though you are just bringing up the interface for the first time you don't need it. you can use the same formatting to reset your nwid or your nwkey (that's the key for WEP connections). In my scripts i usually ifconfig -nwid -wpakey -nwkey in the beginning to reset it, and then bring it back up with the correct values. Finally this question should probably be on serverfault – ramrunner Sep 19 '14 at 16:45
  • I see what you mean, @ramrunner. That in my case `-wpa` sufficed, is a question of my personal history of using `ifconfig` since the system start. So naturally, your turning off all three parameters would handle all possible cases of previous usage. Thanks. – Wojciech Gac Sep 21 '14 at 07:57