树莓派进阶之路 (037) - 设置树莓派3 B+的静态IP

时间:2024-01-18 16:03:50

修改/etc/dhcpcd.conf 文件

sudo vim /etc/dhcpcd.conf

interface eth0

static ip_address=192.168.0.10/
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 interface wlan0 static ip_address=192.168.0.200/
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

上面的配置文件中 , eth0是有线的配置  , wlan0是无线配置

ip_address就是静态IP , 后面要接/24

routers是网关

static domain_name_servers是DNS