First go to network configuration file of interface
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
NETWORK=192.168.2.0
IPADDR=192.168.2.23
NETMASK=255.255.255.0
IPADDR=192.168.2.23
NETMASK=255.255.255.0
GATEWAY=192.168.2.1
#vi /etc/resolv.conf
nameserver 8.8.8.8 # Replace with your nameserver ip
nameserver 4.2.2.2 # Replace with your nameserver ip
Now just restart network service
#service network restart