树莓派配置固定IP地址

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

root@raspberrypi:~# vi /etc/dhcpcd.conf

2、修改以下参数配置,如果没有就在文件底部添加

有线配置:
interface eth0
static ip_address=192.168.1.188/24
static routers=192.168.1.1
static domian_name_servers=114.114.114.114 114.114.114.115

无线配置:
interface wlan0
static ip_address=192.168.1.188/24
static routers=192.168.1.1
static domian_name_servers=114.114.114.114 114.114.114.115

3、重启系统

root@raspberrypi:~# reboot

Leave a Reply