1. View your existing ip address (if you connect to DHCP server devices)
ifconfig eth0
2. View your gateway ip address (if you connect to DHCP server devices)route -n
3. Note your ip address and gateway ip addressfor example
Ip address : 192.168.1.101
Subnet mark : 255.255.255.0
Bordcast : 192.168.1.255
Gateway address : 192.168.1.1
4. Design your ip address to use
for example
Ip address : 192.168.1.150
5. Edit interface file
sudo nano /etc/network/interfaces
find "iface eth0 inet dhcp"edit to "iface eth0 inet static"
and add static ip config after this line
address 192.168.1.150 (you design)
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 192.168.1.1
6. Restart network service
sudo service networking restart
if you restart service but ip address not change you must restart raspberry pisudo shutdown -r now
Watch video "Fix IP address to Raspberry pi"