Proceed as pi.
Modify the ‘dhcpcd.conf’ file
sudo nano /etc/dhcpcd.conf
Add the following the lines:
interface eth0 static ip_address=192.168.0.31/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1
IP: 192.168.0.31
Gateway: 192.168.0.1
Raspberry pi reboot:
sudo reboot