admin管理员组文章数量:1537537
2024年1月25日发(作者:)
OPENWRT挂载USB无线网卡实现有线无线叠加教程
目 的:通过叠加有线网络和无线网络提升本地网络带宽
现有设备:中兴H618B路由器(官方固件)、水星MERCURY54M USB无线网卡 MW54U ver:7.0(AR9271芯片)
当前网络环境:1、电脑和手机分别通过本地路由器连接至公司内部局域网。
2、周围存在可用的无线网络信号(WIFI)。
适用阅读对象:初级使用者、对高阶使用者有一定参考价值
参考文献:1、Program to install ath9k_htc (Atheros Linux Driver)
链接地址:/?t=1564278
2、New package: mwan3; multi-wan policy routing
链接地址:/?id=39052
需要的软件:1、OPENWRT固件(采用原版/backfire/10.03.1/brcm47xx/)
2、TFTP、WinSCP、Putty(请自行百度搜索)
3、MWAN3(采用最新版,到/folder/fvd0r4i8n4ikg/mwan3下载luci-app-mwan3_1.1-13_、mwan3_1.2-17_)
一、刷新固件
默认路由器现在使用中兴原版固件。我们使用TFTP把上传路由器刷新,具体方法及过程不在本文探讨范围,请百度搜索(有很多教程)。
二、配置OPENWRT
1、 在浏览器输入192.168.1.1 输入用户名:root 密码:root 进入web管理界面。检查路由器相关选项保证路由器能够连接外网。
2、 进入如下界面安装以下软件包(10个):
luci-i18n-chinese #luci中文语言包
kmod-usb-core #内核支持通用串行总线
kmod-usb-ohci #安装usb ohci控制器驱动
kmod-usb-uhci #UHCI USB控制器
kmod-usb2 #安装usb2.0
usbutils
kmod-ath # ATHEROS驱动
kmod-ath9k
kmod-ath9k-common #安装kmod-ath9k时会自动添加
kmod-ath9k-htc
3、 配置中文界面和时间设置(可选)
一定记得点右下角Save & Apply 按钮
改时间服务器
一定记得点右下角Save & Apply 按钮
4、其他设置:
记得要保存并重启路由器。
三、配置网卡
1、 把usb无线网卡插入路由器的usb接口。
2、 用putty登陆路由器
root@Sun:~# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0cf3:1006 Atheros Communications, Inc. TP-Link TL-WN422G v2 802.11g [Atheros
AR9271]
root@Sun:~#
可以看到网卡被当作 TP-Link TL-WN422G,呵呵,不管他,只要能用就行。。
root@Sun:~# dmesg
......
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: World regulatory domain updated:
cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
b43-phy0: Broadcom 5354 WLAN found (core revision 13)
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Registered led device: b43-phy0::tx
Registered led device: b43-phy0::rx
Registered led device: b43-phy0::radio
Broadcom 43xx driver loaded [ Features: PL ]
Broadcom 43xx-legacy driver loaded [ Features: PLID ]
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 24
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nf_conntrack version 0.5.0 (463 buckets, 1852 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl _conntrack_acct=1 to enable it.
xt_time: kernel timezone is -0000
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci_hcd ssb0:1: SSB OHCI Controller
ohci_hcd ssb0:1: new USB bus registered, assigned bus number 1
ohci_hcd ssb0:1: irq 6, io mem 0x18003000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd ssb0:1: SSB EHCI Controller
ohci_hcd ssb0:1: new USB bus registered, assigned bus number 2
ohci_hcd ssb0:1: irq 6, io mem 0x18003800
ohci_hcd ssb0:1: USB 0.0 started, EHCI 1.00
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
uhci_hcd: USB Universal Host Controller Interface driver
usbcore: registered new interface driver ath9k_htc
usb 2-1: new high speed USB device using ohci_hcd and address 2
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: ath9k_htc: Transferred FW: htc_, size: 51272
ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.3
ath: EEPROM regdomain: 0x809c
ath: EEPROM indicates we should expect a country code
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x52
ath: Country alpha2 being used: CN
ath: Regpair used: 0x52
ieee80211 phy1: Atheros AR9271 Rev:1
cfg80211: Calling CRDA for country: CN
Registered led device: ath9k_htc-phy1
usb 2-1: ath9k_htc: USB layer initialized
cfg80211: Regulatory domain changed to country: CN
cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (N/A, 3000 mBm)
b43-phy0: Loading firmware version 508.1084 (2009-01-14 01:32:01)
b43-phy0: Loading firmware version 508.1084 (2009-01-14 01:32:01)
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
device wlan0 left promiscuous mode
br-lan: port 2(wlan0) entering disabled state
device wlan0 entered promiscuous mode
br-lan: port 2(wlan0) entering forwarding state
root@Sun:~#
如果红色部分出现如下代码:
ath9k_htc 4-2:1.0: ath9k_htc: Target is unresponsive
Failed to initialize the device
ath9k_htc: probe of 4-2:1.0 failed with error -22
usbcore: registered new interface driver ath9k_htc
说明挂载网卡失败
只需要把usb网卡拔下再重新接入即可正常。(以后usb无线网卡出现异常都可如此处理)
#插入USB无线网卡
root@Sun:~#ifconfig wlan1 up
#生成默认无线设置 也就是将USB无线网卡在web界面里出现radio1
root@Sun:~#wifi detect > /etc/config/wireless
然后进web 设置无线网卡
3、 在web界面修改有线连接(WAN)名称为wan1
新建虚拟接口wan2指向radio1
此过程较复杂,请搜索相关教程。
四、安装MWAN3
1、 使用WinSCP上传luci-app-mwan3_1.1-13_和mwan3_1.2-17_至路由器/tmp/下
2、 用putty登陆路由器并安装MWAN3
root@Sun:~#ipkg install mwan3_1.2-17_
root@Sun:~#ipkg install luci-app-mwan3_1.1-13_
五、重启路由器即可。
版权声明:本文标题:OPENWRT挂载USB无线网卡实现有线无线叠加教程 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1706165574a173886.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论