In this section, We have used 192.168.100.50 as our IP.
First, you need to edit /etc/network/interfaces:
sudo vi /etc/network/interfaces auto eth0 iface eth0 inet static address 192.168.100.50 netmask 255.255.255.0 gateway 192.168.100.1
And then, edit resolv.conf:
sudo vi /etc/resolv.conf nameserver 192.168.100.1
You need to restart the system for the changes to take effect.