找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 20669|回复: 11

OpenWrt再次动手玩: 多WLAN客户端 + 带宽叠加

[复制链接]
发表于 2011-1-3 22:40 | 显示全部楼层 |阅读模式
这篇文章算给前几天的讨论一个交待: https://www.right.com.cn/forum/thread-44069-1-1.html

原文发表于: http://hi.baidu.com/myeyre/blog/ ... 26e74695ee3741.html

OpenWrt再次动手玩: 多WLAN客户端 + 带宽叠加

OpenWrt Playground: Multi WLAN Load Balancing

#refer to:
#H618b、rg100a刷OpenWrt固件及使用3G上网卡+宽带合并
http://www.51nb.com/forum/viewthread.php?tid=948344
#rg100a使用OpenWrt,单路由实现多个3G上网卡宽带合并
http://www.51nb.com/forum/viewthread.php?tid=1034040
#使用macvlan+multiwan 单线多拨 教程
http://www.openwrt.org.cn/bbs/viewthread.php?tid=1201
#单wan口多拨宽带合并 macvlan+mroute的安装和配置 教程
http://www.openwrt.org.cn/bbs/viewthread.php?tid=1250
#单线多拨 宽带叠加nwan安装配置教程
http://www.openwrt.org.cn/bbs/viewthread.php?tid=2909
#db120+760n中继教程:
http://www.openwrt.org.cn/bbs/viewthread.php?tid=766
#Multi-WAN Load Balancing:
https://forum.openwrt.org/viewtopic.php?id=23904
#Multi-Route
http://wiki.x-wrt.org/index.php/Multi-Route

ZTE ZXV10 H618B running OpenWrt Backfire 10.03 brcm47xx
Linksys WRT54GS v1 running OpenWrt Backfire 10.03 brcm47xx

#Install drivers for USB Wireless cards
#General USB driver, OHCI driver needed for H618B, can't tell why
opkg update
opkg install kmod-usb2 kmod-usb-ohci usbutils
#Inventel UR054g(瑞银)(Conexant GW3887IK)
opkg install kmod-p54-usb
#Sagem XG760N(Zydas ZD1211B)
opkg install kmod-zd1211rw


#WRTSL54GS
opkg install kmod-usb2 usbutils kmod-p54-usb kmod-zd1211rw
#H618B
opkg install kmod-usb2 kmod-usb-ohci usbutils kmod-p54-usb kmod-zd1211rw

#opkg install luci-app-upnp luci-app-qos luci-app-ddns luci-app-livestats

reboot

#确认USB网卡被正确驱动
lsusb
dmesg
logread

ls -l /sys/class/net/
cat /proc/net/dev

iw list
iw phy1 info

#可选: 由于插入及检测到的顺序不同, 各网卡的设备名wlanx飘忽不定, 对多wan叠加配置没有影响, 但是看着难受, 使用udev搞定之
#udev可以给设备一个固定的名字, 但是也可能造成设备识别问题, H618B不建议使用, 但WRTSL54GS好像没有这个问题
#udev for persistent dev names.
opkg install udev

cat > /etc/init.d/udev
#!/bin/sh /etc/rc.common
# Copyright (C) 2009 OpenWrt.org

START=19
start() {
        killall udevd > /dev/null 2> /dev/null
        udevd --daemon
        udevadm trigger
        udevadm settle
        sleep 5                                 
}

stop() {
        killall udevd
}
^D

chmod a+x /etc/init.d/udev
/etc/init.d/udev enable
/etc/init.d/udev start

#依次插入各个USB网卡, udev会自动为其生成命名规则.
#cat /etc/udev/rules.d/70-persistent-net.rules

#或, 手工定义...
udevadm info -a -p /sys/class/net/wlan0|grep 'ATTR{address}'
cat > /etc/udev/rules.d/10-net.rules
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:90:4c:c1:04:51", SYMLINK="wl0", RUN="/sbin/ifup wl0"
^D


#此前已配置了内置网卡的中继wan0, 这里增加wan1-4的配置:

#for CMCC, login using wget or curl
#        option 'ssid' 'CMCC'
#        option 'encryption' 'none'
cat >> /etc/config/wireless
#
config 'wifi-device' 'radio1'
        option 'type' 'mac80211'
        option 'macaddr' '00:60:B3:46:BB:55'
        option 'hwmode' '11g'
        option 'disabled' '0'
        option 'channel' '1'

config 'wifi-iface'
        option 'device' 'radio1'
        option 'ssid' 'SSID2Connect'
        option 'mode' 'sta'
        option 'encryption' 'psk2'
        option 'key' 'WPA2Key'
        option 'network' 'wan1'

#
config 'wifi-device' 'radio2'
        option 'type' 'mac80211'
        option 'macaddr' '00:0B:6B:9D:52:05'
        option 'hwmode' '11g'
        option 'disabled' '0'
        option 'channel' '1'

config 'wifi-iface'
        option 'device' 'radio2'
        option 'ssid' 'SSID2Connect'
        option 'mode' 'sta'
        option 'encryption' 'psk2'
        option 'key' 'WPA2Key'
        option 'network' 'wan2'

#
config 'wifi-device' 'radio3'
        option 'type' 'mac80211'
        option 'macaddr' '00:0B:6B:A1:AD:7E'
        option 'hwmode' '11g'
        option 'disabled' '0'
        option 'channel' '1'

config 'wifi-iface'
        option 'device' 'radio3'
        option 'ssid' 'SSID2Connect'
        option 'mode' 'sta'
        option 'encryption' 'psk2'
        option 'key' 'WPA2Key'
        option 'network' 'wan3'

#
config 'wifi-device' 'radio4'
        option 'type' 'mac80211'
        option 'macaddr' '00:0B:6B:A1:6A4'
        option 'hwmode' '11g'
        option 'disabled' '0'
        option 'channel' '1'

config 'wifi-iface'
        option 'device' 'radio4'
        option 'ssid' 'SSID2Connect'
        option 'mode' 'sta'
        option 'encryption' 'psk2'
        option 'key' 'WPA2Key'
        option 'network' 'wan4'

^D


cat >> /etc/config/network
config 'interface' 'wan1'
        option 'ifname' 'radio1'
        option 'proto' 'dhcp'

config 'interface' 'wan2'
        option 'ifname' 'radio2'
        option 'proto' 'dhcp'

config 'interface' 'wan3'
        option 'ifname' 'radio3'
        option 'proto' 'dhcp'

config 'interface' 'wan4'
        option 'ifname' 'radio4'
        option 'proto' 'dhcp'

^D

#zone wan
uci set firewall.@zone[1].network='wan wan0 wan1 wan2 wan3 wan4'
uci commit


#重启, 确认各个中继工作正常
reboot
#or(even reboot doesn't get everything right sometimes.):
/etc/init.d/network restart
/etc/init.d/firewall restart

#OK. Seems fine so far.
ifconfig
ip route
iptables -nvL -t nat

#Multi-WAN Load Balancing script and luci interface:
opkg install ftp://ftp.netlab7.com/multiwan_1.0.18.ipk
opkg install ftp://ftp.netlab7.com/luci-app-multiwan_1.0.16.ipk

#配置wan0-4, weight为 2:2:2:2:2
uci delete multiwan.wan
commit
#web ui is fine.

#oops, 网关一样的情况下, multiwan只会走一个wan
/etc/init.d/multiwan disable


#m-route
opkg install m-route

#干掉不用的wan口, 添加wan0-4 1:1:1:1:1
#vi /etc/config/mroute
for n in 0 1 2 3 4
do
echo -n "
config 'wanif' 'wan${n}'
        option 'weight' '1'
        option 'name' 'WLAN_${n}'
" >>/etc/config/mroute
done

#重启使设置生效
reboot

#It Works.

#NWAN by zjhzzyf@openwrt.org.cn
opkg install http://nwan.3322.org/nwan.ipk

#干掉不用的wan口, 添加wan0-4 2:2:2:2:2
uci delete nwan.wan
uci commit
#web ui is fine.

#重启使设置生效
reboot
#or:
#/etc/init.d/network restart
#/etc/init.d/firewall restart

/etc/init.d/nwan restart

#nwan bug?? 对WLAN也是用端口定义(radiox)而非设备名, 导致缺省路由修改/添加失败??
#total default route : ip route change default scope global nexthop via 192.168.8.1 dev radio0 weight 2 nexthop via 192.168.8.1 dev radio1 weight 2 nexthop via 192.168.8.1 dev radio2 weight 2 nexthop via 192.168.8.1 dev radio3 weight 2 nexthop via 192.168.8.1 dev radio4 weight 2
#手工修改如下:
#ip route change default scope global             \
ip route add default scope global                \
        nexthop via 192.168.8.1 dev wlan1 weight 2     \
        nexthop via 192.168.8.1 dev wlan3 weight 2     \
        nexthop via 192.168.8.1 dev wlan4 weight 2     \
        nexthop via 192.168.8.1 dev wlan5 weight 2     \
        nexthop via 192.168.8.1 dev wlan6 weight 2


#It Works.



结语:

由于唯一性认证, PPPoE单账号多拨并不是所有运营商都适用, 即使适用也有随时被封的危险.

CMCC的WLAN也是有唯一性认证的, Multi WLAN也需要多个登录账号, 虽然套餐低至每小时1毛钱. 其他运营商的WLAN情况未知. 坏孩子们可能会动动邻居们的歪脑筋...

由于USB外接网卡的原因, 多个WLAN/WWAN叠加的稳定性也稍稍打了折扣. 甚至OpenWrt上有时候USB网卡的初始化可能也需要人工参与, 太过折腾, 易用性大打折扣.

现有的多wan叠加软件, 在功能, 稳定性, 易用性上也都还不够完美.

总之, 多WAN叠加暂时还不好玩.
我的恩山、我的无线 The best wifi forum is right here.
发表于 2011-2-18 21:05 | 显示全部楼层
悲哀,怎么不顶呢!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-2-18 21:56 | 显示全部楼层
高手
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-2-19 09:05 | 显示全部楼层
怎么不顶呢!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-2-19 10:00 | 显示全部楼层
好东西 但是菜鸟一只 没看明白 就一个瑞银和一个760n 怎么会出现radio1-4
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-2-22 10:10 | 显示全部楼层
技术贴很不错,但是网络不支持哈哈,不过现在出的电信4m带电视那种听说是每台电脑上网就拨号一次,看来有多拨的潜力。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2011-2-22 13:06 | 显示全部楼层
好东西 但是菜鸟一只 没看明白 就一个瑞银和一个760n 怎么会出现radio1-4
neowang6688 发表于 2011-2-19 10:00


笔记,没细写呵呵

用了3块瑞银,一块760n,另外一个内置网卡,总共5个WLAN
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-2-25 10:16 | 显示全部楼层
这个不错,帮顶。。。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-2-25 11:01 | 显示全部楼层
本人铁通线路,试了N回,看来的确是CMCC限制了·
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2011-3-21 20:20 | 显示全部楼层
普通的中继都不知道怎么没置,感觉比DDWRT的难太多了!!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-4-5 22:43 | 显示全部楼层
好东西 但是菜鸟一只 没看明白
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-5-20 11:17 | 显示全部楼层
如果是单用路由可以实现电信wifi加有线拨号双接入吗?
1Client + lan口拨号,然后nwan输出,这个思路是否正确?还能不能增加一个AP?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-19 09:43

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表