树莓派设置WIFI
启动设置WIFI
新建 wpa_supplicant.conf
1
2
3
4
5ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
ssid="路由名称"
psk="密码"
}
重启电脑
扫描WiFi
1 | sudo iwlist wlan0 scan | grep ESSID |
设置静态IP
编辑/etc/network/interfacessudo vi /etc/network/interfaces
找到allow-hotplug wlan0
一栏
修改为1
2
3
4iface wlan0 inet static
address 192.168.0.118
gateway 192.168.0.1
netmask 255.255.255.0
注意,如果/etc/network/interfaces
有如下提示:1
2# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
需要在/etc/dhcpcd.conf
配置静态IP1
2
3
4interface eth0
static ip_address=192.168.1.4/24 # /24表示掩码为 255.255.255.0
static routers=192.168.1.1
static domain_name_servers=114.114.114.114 114.114.115.115
本站采用「署名 4.0 国际」进行许可。