先配置有线
设置lan ip(即访问路由的ip)
1
|
uci
set
network.lan.ipaddr=[lan ip]
|
1
2
3
4
|
pppoe用户
uci
set
network.wan.proto=pppoe
//
设置wan口类型为pppoe
uci
set
network.wan.username=[上网帐户]
uci
set
network.wan.password=[上网密码]
//
这两行设置pppoe用户名和密码
|
如果要挂在上级路由下面就这样
1
2
3
4
|
uci
set
network.wan.proto=none
//
关掉wan
uci
set
network.lan.gateway=[上级路由ip]
//
网关指向上级路由
uci
set
network.lan.dns=[上级路由ip]
//dns
指向上级路由
uci
set
dhcp.lan.ignore=1
//
关掉lan的dhcp
|
然后是无线
1
2
3
4
5
6
7
8
|
uci
set
wireless.@wifi-device[0].disabled=0
//
打开无线
uci
set
wireless.@wifi-device[0].txpower=17
//
设置功率为17dbm 太高会烧无线模块
uci
set
wireless.@wifi-device[0].channel=6
//
设置无线信道为6
uci
set
wireless.@wifi-iface[0].mode=ap
//
设置无线模式为ap
uci
set
wireless.@wifi-iface[0].ssid=[自己设置SSID]
//
设置无线SSID
uci
set
wireless.@wifi-iface[0].network=lan
//
无线链接到lan上
uci
set
wireless.@wifi-iface[0].encryption=psk2
//
设置加密为WPA2-PSK
uci
set
wireless.@wifi-iface[0].key=[密码]
//
设置无线密码
|
最后应用配置
1
2
|
uci commit
//
应用
/etc/init
.d
/network
restart
//
重启网络服务
|
本文转自灬落魄灬 51CTO博客,原文链接:http://blog.51cto.com/smoke520/1830601,如需转载请自行联系原作者