树莓派3B+设置静态IP地址

1. 编辑/etc/dhcpcd.conf文件:

sudo leafpad /etc/dhcpcd.conf

2. 将静态IP实例中的两行取消注释:

# Example static IP configuration:
interface eth0
static ip_address=192.168.1.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

192.168.1.10/24中的24表示子网掩码为255.255.255.0

3. 重启

sudo reboot

 

你可能感兴趣的:(树莓派)