2021-05-12 14:32:11
Ubuntu 16.04下無線網絡卡無法正常連網
背景:無線網絡卡初次連線可以正常上網,但是用了一會兒就會出現無法上網的情況
版本: Ubuntu 16.04
一.分析:
1.使用ifconfig命令發現不會顯示無線網絡卡,說明無線網絡卡被關閉,筆者輸出的資訊如下:
linuxidc@linuxidc:~$ ifconfig
eth0 Link encap:乙太網 硬體地址 16:03:71:93:64:22
inet 地址:192.168.100.3 廣播:192.168.100.255 掩碼:255.255.255.0
inet6 地址: fe80::1a03:73ff:fe92:632e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 躍點數:1
接收封包:295308 錯誤:0 丟棄:0 過載:0 幀數:0
傳送封包:208860 錯誤:1 丟棄:0 過載:0 載波:0
碰撞:0 傳送佇列長度:1000
接收位元組:394951279 (394.9 MB) 傳送位元組:19510963 (19.5 MB)
lo Link encap:本地環回
inet 地址:127.0.0.1 掩碼:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 躍點數:1
接收封包:943526 錯誤:0 丟棄:0 過載:0 幀數:0
傳送封包:943526 錯誤:0 丟棄:0 過載:0 載波:0
碰撞:0 傳送佇列長度:1
接收位元組:464924375 (464.9 MB) 傳送位元組:464924375 (464.9 MB)
2.使用lshw命令輸出資訊(只貼出無線網絡卡相關的資訊)如下:
linuxidc@linuxidc:~$ lshw
*-network DISABLED
description: Wireless interface
physical id: 2
logical name: wlan0 1
serial: 92 :31:e3:4a:75:f2
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=brcmsmac driverversion=4.1.0-78-generic firmware=102.304 ip=192.168.100.131 link=no multicast=yes wireless=IEEE 802.11bgn
從第2點的"*-network DISABLED"這一行可以明確無線網絡卡在硬體上被禁止了
3.於是開啟硬體開關,但嘗試了很多次都沒成功,通過rfkill的輸出資訊來判斷:
linuxidc@linuxidc:~$ sudo rfkill list all
[sudo] linuxidc 的密碼:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
從"Hard blocked: yes"這一行可以看出無線網絡卡在硬體上被block
4.通過第3點開始懷疑無線網絡卡的驅動是否安裝正確
二.安裝無線網絡卡驅動:
1.解除安裝之前安裝的無線網絡卡驅動(如果之前安裝了的情況下,否則請無視):
sudo apt-get purge firmware-b43-installer
sudo apt-get purge bcmwl-kernel-source
2.獲取無線網絡卡的PCI.ID (筆者的無線網絡卡品牌是broadcom,所以指定廠商代號為14e4)
linuxidc@linuxidc$ lspci -nn -d 14e4:
09:00.0 Network controller [0280]: Broadcom Corporation BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01)
從以上資訊中獲取到關鍵資訊為:[14e4:4727] (rev 01)
-nn 選項是只顯示指定的廠商程式碼對應的裝置
-d 選項是顯示廠商代號和裝置代號,同時顯示數位和名稱
3.更新ubuntu的PCI.IDs列表:
3.1sudo apt-get update (首先更新軟體包索引)
3.2sudo update-pciids (如果一直沒有響應,那就將其中斷),直接替換原來的/usr/share/misc/pci.ids檔案,命令如下:
cd /usr/share/misc/
sudo mv pci.ids pci.ids.orig
然後從http://pci-ids.ucw.cz/下載最新的pic.ids檔案
將下載好的pci.ids檔案複製到/usr/share/misc/目錄下(由於筆者認為目前的無線網絡卡硬體不是很新,因此無線網絡卡的資訊在原來的pci.ids檔案中是存在的,因此並沒有手動去更新pci.ids檔案)
4.安裝對應的無線網絡卡驅動,從下表即可獲得對應驅動的軟體包名
PCI.ID 16.04 LTS 17.10+
------------------------------------------------------------------------------------
14e4:0576 Special Case #1 UNKNOWN
14e4:4301 firmware-b43-installer firmware-b43-installer
14e4:4306 firmware-b43-installer firmware-b43-installer
14e4:4306 rev 02 firmware-b43-installer firmware-b43-installer
14e4:4306 rev 03 firmware-b43-installer firmware-b43-installer
14e4:4307 firmware-b43-installer firmware-b43-installer
14e4:4311 firmware-b43-installer firmware-b43-installer
14e4:4311 rev 01 firmware-b43-installer firmware-b43-installer
14e4:4312 firmware-b43-installer firmware-b43-installer
14e4:4313 firmware-b43-installer firmware-b43-installer
14e4:4315 firmware-b43-installer firmware-b43-installer
14e4:4315 rev 01 firmware-b43-installer firmware-b43-installer
14e4:4318 firmware-b43-installer firmware-b43-installer
14e4:4318 rev 02 firmware-b43-installer firmware-b43-installer
14e4:4319 firmware-b43-installer firmware-b43-installer
14e4:4320 rev 02 firmware-b43-installer firmware-b43-installer
14e4:4320 rev 03 firmware-b43-installer firmware-b43-installer
14e4:4321 firmware-b43-installer firmware-b43-installer
14e4:4324 firmware-b43-installer firmware-b43-installer
14e4:4325 firmware-b43-installer firmware-b43-installer
14e4:4328 firmware-b43-installer firmware-b43-installer
14e4:4329 bcmwl-kernel-source bcmwl-kernel-source
14e4:432a bcmwl-kernel-source bcmwl-kernel-source
14e4:432b bcmwl-kernel-source bcmwl-kernel-source
14e4:432c bcmwl-kernel-source bcmwl-kernel-source
14e4:432d bcmwl-kernel-source bcmwl-kernel-source
14e4:4331 firmware-b43-installer firmware-b43-installer
14e4:4335 firmware-b43-installer firmware-b43-installer
14e4:4350 firmware-b43-installer firmware-b43-installer
14e4:4353 Special Case #1 UNKNOWN
14e4:4353 rev 01 Special Case #1 UNKNOWN
14e4:4357 Special Case #1 UNKNOWN
14e4:4358 bcmwl-kernel-source bcmwl-kernel-source
14e4:4359 bcmwl-kernel-source bcmwl-kernel-source
14e4:4360 bcmwl-kernel-source bcmwl-kernel-source
14e4:4365 bcmwl-kernel-source bcmwl-kernel-source
14e4:4365 rev 01 bcmwl-kernel-source bcmwl-kernel-source
14e4:43a0 bcmwl-kernel-source bcmwl-kernel-source
14e4:43ae rev 02 UNKNOWN UNKNOWN
14e4:43b1 bcmwl-kernel-source bcmwl-kernel-source
14e4:43b1 rev 03 bcmwl-kernel-source bcmwl-kernel-source
14e4:43c3 rev 04 UNKNOWN Special Case #2
14e4:4727 bcmwl-kernel-source bcmwl-kernel-source
14e4:4727 rev 01 bcmwl-kernel-source bcmwl-kernel-source
14e4:a962 firmware-b43-installer firmware-b43-installer
------------------------------------------------------------------------------------
4.1從上表中可以看到bcmwl-kernel-source與14e4:4727 rev 01對應,因此安裝命令如下:
sudo apt-get install bcmwl-kernel-source
4.2重新啟動
相關文章