[SOLVED]How to set static ip of eth0 Port

I have started using Openhab for home automation using raspberry Pi 3B since one month.
Openhab Version:- Openhabian-v1-4-released/37398
My raspberry Pi is connected with modem using ethernet cable & working fine.
But IP of raspberry Pi changed during power cycle restart so I want to fix IP of my raspberry Pi.
My modem have no facility for this.
I think I can do it from PI but no idea how to do.
Please suggest how to proceed.

Snapshots of ifconfig

Use sudo nano /etc/dhcpcd.conf and edit the file to add the static IP.

Here’s a link to reference if needed.


1 Like

I tried alot but don’t know why I am not able to assign static ip. RPI get ip from DHCP all time.
Finally I take backup of my Openhab, install fresh Openhab then tried steps mentioned in below URL