-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
通过SSH登录你的树莓派,编辑/etc/network/interfaces
$ sudo apt-get update
$ sudo apt-get install nano
$ sudo nano /etc/network/interfaces
修改成如下
auto lo
iface lo inet loopback
#auto eth0
#allow-hotplug eth0
#iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.155.4
netmask 255.255.255.0
gateway 192.168.155.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf紧接着在/etc/wpa_supplicant/wpa_supplicant.conf文件中配置你的无线热点信息
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
仿照示例
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid="OpenWrt"
psk="******"
key_mgmt=WPA-PSK
priority=3
}其中ssid表示热点名称,psk表示对应的密码,重启后你的树莓派会自动连接热点。
