
sudo mcedit /etc/dhcpcd.conf
En el fondo añadir:
interface eth0
static ip_address=192.168.0.2/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8
En caso de querer usar la interfaz wifi
interface wlan0
static ip_address=192.168.0.51/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8
guardar y reinciar el raspberrypi4
https://pimylifeup.com/raspberry-pi-static-ip-address/
Aquí arriba la fuente