I am planning on using openwrt. Unfortunatelly the wiki is not particularly helpful.

How do I setup the wlan interface for WPA2 PSK? I got as far as /etc/config/wireless, but there are no examples for anything other than option encryption none.


See the OpenWRT manual on wireless settings. There are two types of wireless settings: device settings, and interface settings. Encryption is part of the interface settings; below is the format and possible options for the section in /etc/config/wireless.

You may want to look into adding a web configuration for OpenWRT and handling encryption setup there; it will very likely be simpler. X-WRT is one I've used for years on my OpenWRT router, and it's been quite capable. I haven't used recent versions, however, so YMMV.

  config wifi-iface
      option network  <the interface you want wifi to bridge with>
      option device   wifi0, wifi1, wifi2, wifiN
      option mode     ap, sta, adhoc, monitor, or wds
      option txpower  (deprecated) <transmission power in dBm>
      option ssid     <ssid name>
      option bssid    <bssid address>
      option encryption none, wep, psk, psk2, wpa, wpa2
      option key      <encryption key>
      option key1     <key 1>
      option key2     <key 2>
      option key3     <key 3>
      option key4     <key 4>
      option server   <ip address>
      option port     <port>
      option hidden   0,1
      option isolate  0,1

I use the command wifi. First log in to OpenWrt and use wifi detect to create a template

mv /etc/config/wireless /etc/config/wireless.backup
wifi detect > /etc/config/wireless

Now use vi to enable the radio, change SSID, and add encryption and key

config wifi-device  radio0
        option type     mac80211
        option channel  11

           ... skip several lines

        list ht_capab   DSSS_CCK-40
        # option disabled 1    # Not commented out in template

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     Your_ssid     # Originally OpenWrt
        option encryption psk2        # not in template. This selects WPA2 PSK
        option key      Your_key      # not in template

Now save the config file and restart network.

/etc/init.d/network restart

As far as I can tell, openwrt is not really designed for end users who don't have a thorough knowledge of networking. It's more for networking people who want to use it as a base to build products for end users. At least, that's the feeing I got when I tried it out, and from reading through their docs. Perhaps that has changed since.

You might be better off with something like DD-WRT or Tomato, or other third-party firmwares that come with web interfaces.

Edit: On the other hand, I just ran across X-wrt, whose tagline is "OpenWrt for end users." It's a web interface for OpenWrt, and I think I might give it a try.

  • jinx! (on x-wrt if nothing else...) now you owe me a coke, so we're even. Nov 1 '09 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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