13 October 2012

升级

在官网上找到要升级的目标固件,这里是:http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin

ssh登录到tl-wr703n中,将目标固件下载到/tmp。这里注意只能悬在/tmp目录,因为tl-wr703n的内置存储空间总共4M,出去已经安装的固件,剩余空间不足以存放要下载的固件,但是/tmp目录因为挂在的是内存文件系统,所以空间够用。


cd /tmp
wget http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin
wget http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/md5sums
md5sum openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin

把得到的md5与md5sums文件的对应行对比,确保一致。

然后进行更新:

sysupgrade -v ./openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin

更新完毕后会自动重启

配置

1.配置USB

opkg update
opkg install kmod-usb-storage
opkg install block-mount

2.配置USB在启动时自动mount,在/etc/config/fstab中增加以下内容:

config mount
option target /data
option device /dev/sda
option fstype ext4
option options rw,sync
option enabled 1
option enabled_fsck 0

3.配置网络(/etc/config/network),我们要把路由器配置为router AP,也就是AP的WIFI网络,与连接路由的LAN的网络不在一个网段上。

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

config interface 'wan'
option ifname 'eth0'
# option type 'bridge'
option proto 'dhcp'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'

config interface 'wlan0'
option proto 'dhcp'

config 'interface' 'wifi'
option proto static
option ipaddr 192.168.254.254
option netmask 255.255.255.0

4.配置无线AP(/etc/config/wireless)

config wifi-device radio0
option type mac80211
option channel 11
option macaddr ec:17:2f:f0:a3:fe
option hwmode 11ng
option htmode HT20
list ht_capab SHORT-GI-20
list ht_capab SHORT-GI-40
list ht_capab RX-STBC1
list ht_capab DSSS_CCK-40
# REMOVE THIS LINE TO ENABLE WIFI:
# option disabled 1

config wifi-iface
option device radio0
option network wifi
option mode ap
option ssid myssid
option hidden 1
option encryption psk2
option key 'mypass'

5.配置无线AP的DHCP服务:

在/etc/config/dhcp文件后添加:

config 'dhcp' 'wifi'
option 'interface' 'wifi'
option 'start' '150'
option 'limit' '200'
option 'leasetime' '24h'

6.配置防火墙:
在/etc/config/firewall中添加:

config zone
option name wifi
option network 'wifi'
option input ACCEPT
option output ACCEPT
option forward REJECT

config forwarding
option src lan
option dest wan

config forwarding
option src wifi
option dest wan

config forwarding
option src lan
option dest wifi

config forwarding
option src wifi
option dest lan