树莓派无线网络配置

系统Raspbian,无线加密为WPA/WPA2模式。

编辑文件/etc/network/interfaces

删除后改为下列内容

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /boot/wpa.conf
iface default inet static
address 192.168.1.222  #IP自行修改
netmask 255.255.255.0
gateway 192.168.1.1

保存。

在/boot目录下创建wpa.conf文件。
为什么是这个目录,因为这个目录在wingdows下可以读写,方便修改。

写入下列内容
network={
ssid="xxx"  #改为你的wifi接入点名称
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="xxx" #改为你的wifi密码
}

保存。

sudo reboot 重启即可生效。要改接入点,修改/boot/wpa.conf 文件即可。

 

文章评论已关闭