# UPDATE: for newer systems better directly use: # # install dhcpcd: sudo apt-get install dhcpcd5 # # vim /etc/dhcpcd.conf: # # interface eth0 # static ip_address=192.168.1.150/24 # static routers=192.168.1.1 # static domain_name_servers=192.168.1.1 # # # restart dhcpcd: sudo systemctl restart dhcpcd # # now reboot the rpi: sudo reboot # static ip configuration # /etc/netplan/50-cloud-init.yaml network: ethernets: eth0: dhcp4: true optional: true wifis: wlan0: dhcp4: no dhcp6: no addresses: [192.168.1.150/24] gateway4: 192.168.1.1 nameservers: addresses: [1.1.1.1, 8.8.8.8] access-points: "wifiname": password: "password" version: 2