raspberrypi で固定IPを設定する
環境
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
手法
/etc/dhcpcd.conf
のip_address
, routes
, domain_name_servers
を自身の環境に合わせて設定
/etc/dhcpcd.conf
...
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
static ip_address=192.168.0.100/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8
...