Raspiに温湿度センサーをつけたセットを遠隔地にを設置するに当たりあちこちIPアドレスが動くとやっかいなので固定IP化する。
man dhcpcd.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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 |
1 2 3 4 5 6 |
# 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 |
再起動
コメント