openwrt


config wifi-device radio0
option type mac80211
option channel 11
option macaddr 8c:21:0a:ee:ed:b8
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 lan
option mode ap
option ssid OpenWrt
# option encryption none
option encryption psk2
option key 'haohao123'

root@OpenWrt:/etc/config# vim wireless

交叉编译
http://sourceforge.net/apps/mediawiki/psotnic/index.php?title=Compiling_Embedded
下载 psotnic-current.tar.gz
http://ftp.heanet.ie/mirrors/download.sourceforge.net/pub/sourceforge/p/project/ps/psotnic/
我用的psotnic-0.2.14.tar.gz

ubuntu失败
据说gentoo好使


http://wenku.baidu.com/view/52a002bff121dd36a32d8280.html
iptables
http://wenku.baidu.com/view/601aef8583d049649b66580e.html
route


配置参考
http://ninehills.info/2012/05/07/set-openwrt-in-wr703n.html

http://wiki.openwrt.org/toh/tp-link/tl-wr703n
交叉编译
http://blog.csdn.net/ffilman/article/details/5744942


设置/etc/config/network
root@OpenWrt:~# vim /etc/config/network


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'
[color=darkred]option ipaddr '192.168.0.1'[/color]
option netmask '255.255.255.0'
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'

然后703用正常网线连能上网的路由器A(192.168.1.1)

电脑无线选openwrt
ssh root@192.168.1.100
---------
以下是转载

下载安装

访问WR703N在OpenWrt的Wiki页,然后在Flashing一节中找到下载链接:squashfs-factory.bin,下载后别忘了比对md5。[1]
进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。
等待一段时间(~~2min),然后重启路由。
P.S. 官方固件不带WebUI,所以需要对Linux系统较为熟悉,否则可以选择国内有人编译的带LuCI和中文支持的版本,Google即可。
初始配置[2]

首先用一根网线将703N的Lan口和你电脑相连,电脑上设置为DHCP模式。然后
telent 192.168.1.1
成功后出现OpenWrt的欢迎界面:
BusyBox v1.19.4 (2012-05-05 05:41:33 MST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
然后更改root密码:
passwd root
更改root密码后dropbear(SSH 服务)就运行了,输入exit退出telent,然后
ssh root@192.168.1.1
以后就可以通过ssh管理OpenWrt.
网络配置

OpenWrt官方的固件是不带LuCl的,所以初始的网络设定需要在命令行下完成 首先备份相关配置,防止出错:
cp /etc/config ~/ -r
然后用vi修改相关配置(不会用vim的同学悲剧了)。 首先修改/etc/config/wireless文件,注释掉
# option disabled 1
然后修改/etc/config/network文件[3],首先修改lan接口配置,注释掉此行:
# option ifname 'eth0'
然后增加wan接口,如果你上级网络是DHCP的,则文件的末尾添加:
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'
如果你上级网络是静态IP,则在文件的末尾添加:
config interface 'wan'
option ifname 'eth0'
option proto 'static'
option ipaddr '10.22.33.124'
option netmask '255.255.255.0'
option gateway '10.22.33.1'
option dns '202.113.16.10 8.8.8.8'
然后将路由器的Lan/Wan口接到上级网络中,重启路由器。这时便可以通过电脑寻找SSID为 OpenWrt的无线网络,加入后便可以通过:
ssh root@192.168.1.1
来连接路由器。此时703N为无线路由模式,电脑便可以通过703N上网了。
安装软件

然后便可以用大名鼎鼎的opkg包管理系统。主要命令:
# 查看帮助
opkg help
# 更新数据库,必做
opkg update
# 列出已安装的包
opkg list-installed
# 安装LuCI,我就不选择装了,命令行很好
# 参见 http://wiki.openwrt.org/doc/howto/luci.essentials
opkg install luci
各种配置以后补充。暂时先这么用着。另外703N的RAM只有32M,ROM只有4M,所以能做的事情很少。倒是有人换RAM和ROM芯片的,淘宝上RAM和ROM加倍的只卖150元,喜欢OpenWrt的同学可以考虑一下。
TODO:
VPN 无痛fq
GoAgent 无痛fq 3. 无线中继 4. 脱机下载
3G无线网卡支持
F.A.Q

无线加密,修改/etc/config/wireless文件,参见4。配置wpa加密需要修改config wifi-iface段。
option ssid OpenWrt
option encryption psk2
option key 'secret passphrase'
出现路由端可以ping可以上网,而电脑不能上的问题。电脑端ping结果:
From 192.168.1.1: icmp_seq=1 Destination Port Unreachable
这时只需要重启firewall服务即可。
/etc/init.d/firewall restart
dropbear 密钥验证。使用ssh-copy-id是无效的,dropbear只认全局配置5,所以需要:
ssh-copy-id root@192.168.1.1
mv /root/.ssh/authorized_keys /etc/dropbear/authorized_keys
参考文献

http://wiki.openwrt.org/toh/tp-link/tl-wr703n
http://wiki.openwrt.org/doc/howto/firstlogin
http://wiki.openwrt.org/doc/uci/network
http://wiki.openwrt.org/doc/uci/wireless
http://wiki.openwrt.org/oldwiki/dropbearpublickeyauthenticationhowto



拨号上网的配置

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.2.1'
option netmask '255.255.255.0'

config interface 'wan'
option proto 'pppoe'
option ifname 'eth0'
option username '用户名'
option password '20460644'
option defaultrote '1'

改完重启/etc/init.d/network restart

启动luci的http://192.168.2.1
界面
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值