OPENWRT挂载USB无线网卡实现有线无线叠加教程目的:通过叠加有线网络和无线网络提升本地网络带宽现有设备:中兴H618B路由器(官方固件)、水星MERCURY54M USB无线网卡MW54U ver:7.0(AR9271芯片)当前网络环境:1、电脑和手机分别通过本地路由器连接至公司内部局域网。
2、周围存在可用的无线网络信号(WIFI)。
适用阅读对象:初级使用者、对高阶使用者有一定参考价值参考文献:1、Program to install ath9k_htc (Atheros Linux Driver)链接地址:/showthread.php?t=15642782、New package: mwan3; multi-wan policy routing链接地址:https:///viewtopic.php?id=39052需要的软件:1、OPENWRT固件(采用原版/backfire/10.03.1/brcm47xx/openwrt-brcm47xx-squashfs. trx)2、TFTP、WinSCP、Putty(请自行百度搜索)3、MW AN3(采用最新版,到/folder/fvd0r4i8n4ikg/mwan3下载luci-app-mwan3_1.1-13_all.ipk、mwan3_1.2-17_all.ipk)一、刷新固件默认路由器现在使用中兴原版固件。
我们使用TFTP把openwrt-brcm47xx-squashfs.trx上传路由器刷新,具体方法及过程不在本文探讨范围,请百度搜索(有很多教程)。
二、配置OPENWRT1、在浏览器输入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.0usbutilskmod-ath # ATHEROS驱动kmod-ath9kkmod-ath9k-common #安装kmod-ath9k时会自动添加kmod-ath9k-htc3、配置中文界面和时间设置(可选)一定记得点右下角Save & Apply 按钮改时间服务器一定记得点右下角Save & Apply 按钮4、其他设置:记得要保存并重启路由器。
三、配置网卡1、把usb无线网卡插入路由器的usb接口。
2、用putty登陆路由器root@Sun:~# lsusbBus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 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 usbfsusbcore: registered new interface driver hubusbcore: registered new device driver usbcfg80211: 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::txRegistered led device: b43-phy0::rxRegistered led device: b43-phy0::radioBroadcom 43xx driver loaded [ Features: PL ]Broadcom 43xx-legacy driver loaded [ Features: PLID ]PPP generic driver version 2.4.2ip_tables: (C) 2000-2006 Netfilter Core TeamNET: Registered protocol family 24ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Drivernf_conntrack version 0.5.0 (463 buckets, 1852 max)CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or sysctl filter.nf_conntrack_acct=1 to enable it.xt_time: kernel timezone is -0000ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driverohci_hcd ssb0:1: SSB OHCI Controllerohci_hcd ssb0:1: new USB bus registered, assigned bus number 1ohci_hcd ssb0:1: irq 6, io mem 0x18003000usb usb1: configuration #1 chosen from 1 choicehub 1-0:1.0: USB hub foundhub 1-0:1.0: 2 ports detectedohci_hcd ssb0:1: SSB EHCI Controllerohci_hcd ssb0:1: new USB bus registered, assigned bus number 2ohci_hcd ssb0:1: irq 6, io mem 0x18003800ohci_hcd ssb0:1: USB 0.0 started, EHCI 1.00usb usb2: configuration #1 chosen from 1 choicehub 2-0:1.0: USB hub foundhub 2-0:1.0: 2 ports detecteduhci_hcd: USB Universal Host Controller Interface driverusbcore: registered new interface driver ath9k_htcusb 2-1: new high speed USB device using ohci_hcd and address 2usb 2-1: configuration #1 chosen from 1 choiceusb 2-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 creditsath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.3ath: EEPROM regdomain: 0x809cath: EEPROM indicates we should expect a country codeath: doing EEPROM country->regdmn map searchath: country maps to regdmn code: 0x52ath: Country alpha2 being used: CNath: Regpair used: 0x52ieee80211 phy1: Atheros AR9271 Rev:1cfg80211: Calling CRDA for country: CNRegistered led device: ath9k_htc-phy1usb 2-1: ath9k_htc: USB layer initializedcfg80211: Regulatory domain changed to country: CNcfg80211: (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 modebr-lan: port 2(wlan0) entering forwarding statedevice wlan0 left promiscuous modebr-lan: port 2(wlan0) entering disabled statedevice wlan0 entered promiscuous modebr-lan: port 2(wlan0) entering forwarding stateroot@Sun:~#如果红色部分出现如下代码:说明挂载网卡失败只需要把usb网卡拔下再重新接入即可正常。