Quick WiFi Setup - leitec/openwrt-leitec GitHub Wiki

Full documentation is available at the OpenWrt wiki, but for the impatient, a quick setup procedure is shown here. The configuration is stored in /etc/config/wireless, which can be edited directly or manipulated via the command line uci tool. We use the latter here.

First, you can use uci show to see wireless parameters currently configured. Out of the box, it should look something like this:

root@OpenWrt:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.channel=11
wireless.radio0.hwmode=11ng
wireless.radio0.path=platform/rt2800_wmac.0
wireless.radio0.htmode=HT20
wireless.radio0.ht_capab=GF SHORT-GI-20 SHORT-GI-40 TX-STBC RX-STBC12
wireless.radio0.disabled=1
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=radio0
wireless.@wifi-iface[0].network=lan
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].ssid=OpenWrt
wireless.@wifi-iface[0].encryption=none
root@OpenWrt:~# 

The following parameters will set up a network on channel 6 with SSID OpenWrt and a WPA2 PSK thisisatest. Since I am in the US, I set the country code to US. To get access to your locally-allowed channels and power, use your country code instead. This is especially important when using 5GHz channels on the AR725W.

root@OpenWrt:~# uci set wireless.@wifi-iface[0].ssid='OpenWrt'
root@OpenWrt:~# uci set wireless.@wifi-iface[0].encryption='psk2'
root@OpenWrt:~# uci set wireless.@wifi-iface[0].key='thisisatest'
root@OpenWrt:~# uci set wireless.radio0.channel=6
root@OpenWrt:~# uci set wireless.radio0.country=US
root@OpenWrt:~# 

which can then be enabled using:

root@OpenWrt:~# uci set wireless.radio0.disabled=0
root@OpenWrt:~# 

The configuration must then be saved and reloaded:

root@OpenWrt:~# uci commit
root@OpenWrt:~# wifi
Configuration file: /var/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr 00:1d:6a:bb:72:13 and ssid "OpenWrt"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
Command failed: Operation not supported
root@OpenWrt:~# 

You can safely ignore the Command failed error in this case.