解決樹莓派 no wireless interfaces found問題

解決樹莓派 no wireless interfaces found問題

前兩天做樹莓派的ip固定的時候發現設置了eth0的static ip後直接找不到無線網卡,最後找到下面的解決方法

root@raspberrypi:/etc/network# cat interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto eth0
iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual

將interfaces文件修改爲上面所示即可。

linux網絡配置補充

網絡出了幾次問題了,今天正式的看了一下linux的網絡配置。

  • /etc/host.conf 配置域名服務客戶端的控制文件
  • /etc/hosts 配置主機名和IP地址的映射
  • /etc/resolv.conf 域名服務客戶端的配置文件,指定域名服務器的IP地址
  • /etc/network/interfaces 用於設置網絡配置信息(IP地址,子網掩碼,網關IP等)
  • /etc/udev/rules.d/70-persistent-net.rules 記錄主機中所有網卡的MAC地址
  • /etc/xinetd.conf 定義了由進程守護程序xinetd所守護的網絡服務
  • /etc/networks 實現域名與網絡地址的映射
  • /etc/protocols 設定主機使用的協議及各個協議的協議號(協議ID)
  • /etc/services 設定主機上各個網絡服務進程所使用的端口號

這裏網絡配置文件重點注意一下interfaces文件,這裏有幾種設置模板

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto eth0
iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
auto eth0
iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 10.10.3.150 
netmask 255.255.255.0 
gateway 10.10.3.1 

#pre-up ifconfigeth0 hw ether 11:22:33:44:55:66       # 手動設定MAC地址
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章