ラズパイを固定IP化するときは手持ちのルーターでDHCP固定割当をする[raspi]
LAN(ローカル)環境でラズパイを使うときは,ルーターで設定をおこなうことでIPの固定化ができる.
Buffaloのルーターでのやりかた
192.168.11.1を打ち込む
JessieのRaspiでの設定
/etc/dhcpcd.conf をvimなどで開く
以下の内容を追記
interface wlan0static ip_address=192.168.11.40/24static routers=192.168.11.1static domain_name_servers=192.168.11.1Ubuntu18での設定
sudo vim /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by# the datasource. Changes to it will not persist across an instance.# To disable cloud-init's network configuration capabilities, write a file# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:# network: {config: disabled}network:version: 2ethernets:eth0:dhcp4: truematch:macaddress: b8:27:eb:33:39:36set-name: eth0addresses: [192.168.11.19/24]gateway4: 192.168.11.1nameservers:addresses: [192.168.11.1]search: []optional: true