新树莓派配置固定IP地址:

1、查看网络连接:nmcli connection show 使用wlan0 的name名称配置

2、sudo nmcli connection modify “name名称” ipv4.method manual ipv4.addresses 192.168.1.253 ipv4.gateway 192.168.1.1 ipv4.dns 223.5.5.5

3、重启系统

打开配置文件:sudo vim /etc/dhcpcd.conf

在末尾添加:

interface 网卡名
static ip_address=192.168.1.255/24  #树莓派IP
static routers=192.168.1.1    #routers是路由器IP
static domain_name_servers=192.168.1.1     #DNS服务器IP

更多推荐