1. 程式人生 > >ubuntu 16.04 連接無線網絡

ubuntu 16.04 連接無線網絡

無法 xxxx ifdown pcie 獲取ip smbus ast memory 無線網卡配置

最近在閑置的Dell inspiron 6400上安裝了ubuntu 16.04版本,安裝過程此處不細說。

安裝完成後,發現WIFI無法開啟,通過如下方法進行無線網卡的配置。

1)查看對應的PCI設備

root@jerry:/code# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 01) 00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 1 (rev 01) 00:1c.3 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 4 (rev 01)
00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 (rev 01) 00:1d.1 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 (rev 01) 00:1d.2 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 (rev 01) 00:1d.3 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #
4 (rev 01) 00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 01) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1) 00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01) 00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7-M Family) SATA Controller [IDE mode] (rev 01) 00:1f.3 SMBus: Intel Corporation NM10/ICH7 Family SMBus Controller (rev 01) 03:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02) ---> 物理網卡 03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller 03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19) 03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a) 03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05) 0b:00.0 Network controller: Broadcom Corporation BCM4311 802.11b/g WLAN (rev 01) ---> 無線網卡

可以看出,我的Dell 6400 上的無線網卡是 Broadcom 的BCM4311。ubuntu 16.04 默認的網卡驅動無法使該網卡工作,通過如下方法重新安裝網卡驅動:

去掉ubuntu 16.04 默認的broadcom 無線網卡驅動:
sudo apt-get remove bcmwl-kernel-source
  
安裝社區中最新的broadcom 無線網卡驅動:
sudo apt-get install firmware-b43-installer b43-fwcutter
  
查看網卡驅動配置文件:
cat /etc/modprobe.d/* | egrep ‘bcm‘

可以在
blacklist.conf中看到bcm43xx被加入黑名單的配置,去掉該配置。
#blacklist bcm43xx

完成後重啟系統。

2)查看網卡設備

root@jerry:/code# lshw -c network
  *-network               
       description: Network controller
       product: BCM4311 802.11b/g WLAN
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:0b:00.0
       version: 01
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=b43-pci-bridge latency=0
       resources: irq:16 memory:efdfc000-efdfffff
  *-network DISABLED
       description: Ethernet interface
       product: BCM4401-B0 100Base-TX
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth0
       version: 02
       serial: 00:1c:23:ab:0f:56
       capacity: 100Mbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list ethernet physical mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=b44 driverversion=2.0 latency=64 link=no multicast=yes port=twisted pair
       resources: irq:17 memory:ef9fe000-ef9fffff
  *-network DISABLED
       description: Wireless interface
       physical id: 2
       logical name: wlan0
       serial: 00:1e:4c:4a:ee:96
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=b43 driverversion=4.13.0-39-generic firmware=666.2 link=no multicast=yes wireless=IEEE 802.11

可以看到設備中有wlan0的無線網卡設備,配置該設備。

3)配置無線網卡設備。

有自動獲取IP地址和靜態配置IP地址兩種方式。在/etc/network/interfaces文件進行配置。

自動獲取方式添加以下內容:

auto wlan0
iface wlan0 inet dhcp
wpa-ssid xxxxxx
wpa-psk yyyyyy

靜態配置IP地址方式添加如下內容:

auto wlan0
iface wlan0 inet static
address 192.168.0.150
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1 xxx.xxx.xxx.xxx
wpa-ssid xxxxxx
wpa-psk yyyyyyy

其中wpa-ssid這行就是你的WIFI名稱。

wpa-psk就是你的WIFI連接密碼。

其中wlan0是WIFI接口名,請根據你的實際接口名填寫。

4)使能網口設備

修改完成後,通過如下命令使能無線網卡

#首先關閉WIFI
sudo ifdown wlan0

#然後啟用WIFI
sudo ifup -v wlan0

5)測試WIFI

root@jerry:/code# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:1e:4c:4a:ee:96  
          inet addr:192.168.0.150  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:4cff:fe4a:ee96/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12559 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8463 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6858265 (6.8 MB)  TX bytes:1155958 (1.1 MB)
root@jerry:/code# ping www.baidu.com
PING www.a.shifen.com (115.239.211.112) 56(84) bytes of data.
64 bytes from 115.239.211.112: icmp_seq=1 ttl=56 time=8.89 ms
64 bytes from 115.239.211.112: icmp_seq=2 ttl=56 time=4.25 ms
64 bytes from 115.239.211.112: icmp_seq=3 ttl=56 time=4.37 ms
64 bytes from 115.239.211.112: icmp_seq=4 ttl=56 time=9.20 ms
64 bytes from 115.239.211.112: icmp_seq=5 ttl=56 time=8.23 ms

無線網卡配置完成。

ubuntu 16.04 連接無線網絡