kuroの覚え書き

96の個人的覚え書き

openWRT/LaFonera



NATはさせずにAPとして機能させるには


root@OpenWrt:/# vi /etc/config/network

# Copyright (C) 2006 OpenWrt.org

config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0

config interface lan
option ifname eth0
option type bridge
option proto static
option ipaddr 192.168.1.101 #Foneraのアドレス
option netmask 255.255.255.0
option gateway 192.168.1.100
option dns 192.168.1.1
~
~


root@OpenWrt:/# vi /etc/config/wireless

config wifi-device wifi0
option channel 5
option txpower 10

# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 0

config wifi-iface
option device wifi0
option network lan
option mode ap
option ssid OpenWrt
option encryption none
~
~

これだけ。

あとこのままだとWEPしかつかえないのでWPAを使えるようにするには

上記設定のあと

ifup -a && wifi

/etc/init.d/firewall restart

でネットワーク設定を有効にしてから


root@OpenWrt:/# ipkg update
Downloading http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages/Packages
Updated list of available packages in /usr/lib/ipkg/lists/release
Downloading http://downloads.openwrt.org/kamikaze/packages/mips/Packages
Updated list of available packages in /usr/lib/ipkg/lists/packages
Done.

さらに


root@OpenWrt:/# ipkg install wpa-cli hostapd
Installing wpa-cli (0.5.7-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages/./wpa-cli_0.5.7-1_mips.ipk
Installing wpa-supplicant (0.5.7-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages/./wpa-supplicant_0.5.7-1_mips.ipk
Installing libopenssl (0.9.8e-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages/./libopenssl_0.9.8e-1_mips.ipk
Installing zlib (1.2.3-4) to root...
Downloading http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages/./zlib_1.2.3-4_mips.ipk
Installing hostapd (0.5.7-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/packages/./hostapd_0.5.7-1_mips.ipk
Configuring hostapd
Configuring libopenssl
Configuring wpa-cli
Configuring wpa-supplicant
Configuring zlib
Done.

という感じでパッケージをインストール。

・・・したのはいいけど設定方法がいまいちわからないぞ。


追記


uci set wireless.cfg2.encryption=psk
uci set wireless.cfg2.key=<password>
uci commit wireless && wifi

このコマンドで設定可能なことがわかった。