Raspberry PI B+ debian + wifi 网络设置

时间:2021-07-26 16:48:18
# file /etc/network/interfaces
auto lo
iface lo inet loopback #auto eth0
#allow-hotplug eth0
#iface eth0 inet manual auto wlan0
allow-hotplug wlan0 # 动态自动分配IP
#iface wlan0 inet dhcp
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf # 静态IP地址
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 192.168.1.151
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.1
# file /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="ChinaNet-***" # 接入点名称
scan_ssid=1 # 如果无线接入点是隐藏的,加上
key_mgmt=WPA-PSK # 认证密钥管理协议
psk="password" # wifi密码
proto=RSN # WPA2 加密方式
}
~

官方参考文档