RaspberryPi3_固定IPアドレス化

Raspiに温湿度センサーをつけたセットを遠隔地にを設置するに当たりあちこちIPアドレスが動くとやっかいなので固定IP化する。

img_1747
    
man dhcpcd.conf

static value
Configures a static value. If you set ip_address then dhcpcd
will not attempt to obtain a lease and just use the value for the
address with an infinite lease time.

Here is an example which configures a static address, routes and
dns.
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Here is an example for PPP which gives the destination a default
route. It uses the special destination keyword to insert the
destination address into the value.
interface ppp0
static ip_address=
destination routers
# vi /etc/dhcpcd.conf
#IP
interface eth0
static ip_address=192.168.1.126/24
static routers=192.168.1.100
static domain_name_servers=192.168.1.210

再起動

コメント