option 'src' 'wan' option 'proto' 'tcp' option 'dest_port''9091'
4.修改无线默认启动发射功率及加密 /package/mac80211/files/lib/wifi/mac80211.sh 修改内容:注意对齐,参考修改 在文件最后修改以下内容: config wifi-device radio$devidx option option option option $ht_capab
# REMOVETHIS LINE TO ENABLE WIFI:
option option option option option
config wifi-iface option option option option option 码) option EOF
devidx=$(($devidx + 1)) done }
5.修改路由器名字和时区
/package/base-files/files/etc/config/system 修改内容: config system option option option
hostname OpenWrt zonename Asia/Shanghai timezone CST-8
key xxxxxxxx ----------------------密码 (8位) xxxxxxxx device radio$devidx network lan mode ap ssid
OpenWrt_$(cat/sys/class/ieee80211/${dev}/macaddress|tr
\
disabled 0 txpower 17 htmode HT40- noscan 1 country CN type mac80211 channel ${channel}
macaddr $(cat/sys/class/ieee80211/${dev}/macaddress) hwmode 11${mode_11n}${mode_band}
's/://g'|cut -c7-12)
encryption psk2 --------------------加密方式 ( option encryption none 无密
6.默认启动DHCP(703n用来当二级路由)
/trunk/package/network/services/dnsmasq/files/dhcp.conf config dhcp lan option option option option option
7.修改Transmission配置文件
/feeds/packages/net/transmission/files/transmission.config 修改内容:
option rpc_authentication_required true option umask 0
8.修改network配置,配置成二级路由
/trunk/package/base-files/files/etc/config/network 修改内容:
interface lan start 100 limit 150 leasetime 12h
ignore 0 -----------------添加这个
# 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 type bridge option proto static option ipaddr 192.168.3.1 option netmask 255.255.255.0
config interface wan option ifname eth0 option _orig_ifname eth0 option _orig_bridge false option proto dhcp
9. 添加利用reset键的一键切换路由工作模式
在如下位置新建4个文件,在保存后,请修改权限为777
/target/linux/ar71xx/base-files/etc/hotplug.d/button/00-button
./etc/functions.sh do_button () {
local button local action local handler local min local max
config_get button $1 button config_get action $1 action config_get handler $1 handler config_get min $1 min config_get max $1 max
[ \ [ -z \ [ -n \
[ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler } } }
config_load system
config_foreach do_button button
/target/linux/ar71xx/base-files/etc/hotplug.d/button/change2ap #!/bin/sh
uci delete network.wan uci delete network.lan uci set network.lan=interface uci set network.lan.ifname=eth0 uci set network.lan.type=bridge uci set network.lan.proto=static uci set network.lan.ipaddr=192.168.1.2 uci set network.lan.netmask=255.255.255.0 uci set network.lan.gateway=192.168.1.1 uci set network.lan.dns=192.168.1.1 uci commit network uci set dhcp.lan.ignore=1 uci commit dhcp reboot
/target/linux/ar71xx/base-files/etc/hotplug.d/button/change23dhcp
#!/bin/sh
uci delete network.wan uci delete network.lan uci set network.lan=interface
uci set network.lan.type=bridge uci set network.lan.proto=static uci set network.lan.ipaddr=192.168.10.1 uci set network.lan.netmask=255.255.255.0 uci set network.wan=interface uci set network.wan.ifname=eth0 uci set network.wan.proto=dhcp uci set network.wan._orig_ifname=eth0 uci set network.wan._orig_bridge=false uci commit network uci delete dhcp.lan.ignore uci commit dhcp reboot
/target/linux/ar71xx/base-files/etc/hotplug.d/button/change23g
#!/bin/sh
uci delete network.wan uci delete network.lan uci set network.lan=interface uci set network.lan.ifname=eth0 uci set network.lan.type=bridge uci set network.lan.proto=static uci set network.lan.ipaddr=192.168.1.1 uci set network.lan.netmask=255.255.255.0 uci set network.wan=interface uci set network.wan.ifname=ppp0 uci set network.wan.proto=3g uci set network.wan.maxwait=0 uci set network.wan.service=evdo uci set network.wan.device=/dev/ttyUSB0 uci set network.wan.username=ctnet@mycdma.cn uci set network.wan.password=vnet.mobi uci set network.wan.auto=1 uci commit network uci delete dhcp.lan.ignore uci commit dhcp reboot
修改/package/base-files/files/etc/config/system,在尾部添加
config button
option button 'reset' option action 'released'
option handler '/etc/hotplug.d/button/change23g'
option min '0' option max '2'
config button
option button 'reset' option action 'released'
option handler '/etc/hotplug.d/button/change2ap' option min '3' option max '8'
config button
option button 'reset' option action 'released'
option handler '/etc/hotplug.d/button/change2dhcp' option min '9' option max '99'
这样以后按住reset 2秒内, 3-8秒 和 9秒以上,会自动切换到对应的网络配置,并自动重启路由器。 按住reset0-2秒放开,切换到3g配置, 按住reset3-8秒放开,切换到ap模式,
reset 9秒以上放开,切换到二级路由dhcp模式。
10. 修改挂载点
路径:./openwrt/trunk/package/block-mount/files 修改 10-swap, 20-fsck, 40-mount 的权限为777
11.添加对中文编码cp936的支持,openwrt实际上是支持cp936的,只是没开放而已 修改文件openwrt/trunk/package/kernel/modules/nls.mk 在文件尾部添加
define KernelPackage/nls-cp936 SUBMENU:=Native Language Support TITLE:=Codepage 936 (China)
KCONFIG:=CONFIG_NLS_CODEPAGE_936 FILES:=$(LINUX_DIR)/fs/nls/nls_cp936.ko AUTOLOAD:=$(call AutoLoad,25,nls_cp936) $(call AddDepends/nls) endef