Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an OpenBSD 5.1 i386 installed. I have no GUI/X. I googled for the answer but I can't find authentic one. How can I connect to a WPA2 PSK/AES wifi network using only the terminal? (so I don't have a "network manager" to simply select the given SSID, then enter passphare :D)

UPDATE: wifi card: Atheros AR5424, I can see it as "ath0"

UPDATE#2:

DHCP NWID SSID wpakey SSIDPWD

doesn't worked in /etc/hostname.ath0 (then the sh /etc/netstart ath0)

UPDATE#3:

ifconfig ath0 nwid SSID wpa wpapsk $(wpa-psk SSID SSIDPWD)

gived:

ksh: wpa-psk not found
ifconfig: wpapsk: bad value

UPDATE#4:

The router is an OpenWrt 10.03.1 box:

cat /etc/config/wireless
config 'wifi-iface'
    option 'device' 'radio0'
    option 'network' 'lan'
    option 'mode' 'ap'
    option 'ssid' 'SSID'
    option 'encryption' 'psk2+ccmp'
    option 'key' 'SSIDPWD'
    option 'isolate' '1'
    option 'maxassoc' '1'

I didn't seen anything in the logs associated to the openbsd eee pc 701 :D

UPDATE#5: I tested the SSID with the SSIDPWD, and it worked on a Scientific Linux 6.3 notebook.

UPDATE#6:

ifconfig ath0 nwid SSID wpakey SSIDPWD

I tried this one too, it didn't gived back any error messages, but I still can't see anything on the openwrt router, that it tries to connect, I can only see change in "ifconfig ath0" - I can see the "ieee8011" line is filled up.

UPDATE#7: whoops :) I maybe have an idea what is the problem. :D I only have the motherboard of the eee pc 701 and the wifi card in it.. :D with NO ANTENNAS :D - so I will try to find an antenna :)

share|improve this question
    
anyone? :) I have to put a bounty on this :) –  gasko peter Sep 18 '12 at 11:39
    
wpa_supplicant doens't work for you? –  warl0ck Sep 19 '12 at 14:13
    
but how?? :) what are the exact commands? :O –  gasko peter Sep 19 '12 at 16:27
    
What wireless network adapter are you using? –  HeatfanJohn Sep 22 '12 at 0:41
add comment

2 Answers 2

up vote 4 down vote accepted

Create a hostname file in /etc with the interface's name.

/etc/hostname.iwn0

Add to it:

dhcp nwid "Name of network" wpakey password

Restart the interface.

sudo sh /etc/netstart iwn0

This way connection to the wireless network will be attempted on boot.


If you don't know the name of the wireless interface run,

ifconfig

and look for 802.11 in 'media' or wlan in 'groups'.

share|improve this answer
    
@gaskopeter, I am using the exact same way of configuration for my wireless card. kuda has outlined the correct procedure and you can find it in OpenBSD faqs too. I think either you did not name your hostname file correctly - hostname.{interface name} or you did not specify wpakey password correctly in that file. –  Salil Oct 22 '12 at 22:55
add comment

From what I have been reading, apparently on OpenBSD you can configure the SSID and WPA shared secret key on the ifconfig command line.

Please see:

http://vinci.wordpress.com/2008/10/16/using-wpa-on-openbsd/

Configure ral0 to join network “my_net” using WPA-PSK with passphrase “my_passphrase”:

    # ifconfig ral0 nwid my_net wpa wpapsk \
         $(wpa-psk my_net my_passphrase)

and

http://www.openbsd.org/cgi-bin/man.cgi?query=ral&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html

Configure ral0 to join network my_net'' using WPA with passphrase my_passphrase'':

    # ifconfig ral0 nwid my_net wpakey my_passphrase
share|improve this answer
    
I'm surprised that ifconfig ath0 nwid SSID wpakey SSIDPWD didn't work. After you run this command, if you just enter ifconfig what is displayed? Do you get an IP address or any 802.11 information? Can you safely post what is displayed for that command here? –  HeatfanJohn Oct 1 '12 at 15:54
    
"ifconfig ath0" displayed 802.11 information, but it didn't displayed IP address :) –  gasko peter Oct 1 '12 at 16:03
    
Here's an example from Wikipedia that shows an interface that has associated with the access point ieee80211: nwid ARK chan 11 bssid 00:0d:0b:ed:84:fb 100dBm, does yours show that? It would be very helpful if you could post what ifconfig returns for you. –  HeatfanJohn Oct 1 '12 at 16:42
add comment

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.