1. CentOS 6.x
vi /etc/sysconfig/network-scripts/ifcfg-eth0And modify following information:
Then restart network service to update new IP configuration with following command:DEVICE=ifcfg-eth0
ONBOOT=yes
IPADDR=your_ip_address
NETMASK=your_netmask_address
GATEWAY=your_gateway_address
service network restart
2. CentOS 7.x
vi /etc/sysconfig/network-scripts/ifcfg-eth0And modify following information:
Then restart network service to update new IP configuration with following command:DEVICE=”eth0″
BOOTPROTO=”static”
ONBOOT=”yes”
IPV6INIT=”yes”
IPV6_AUTOCONF=”yes”
NM_CONTROLLED=”no”
PEERDNS=”no”
IPADDR=your_ip_address
PREFIX=”your_netmask_prefix″
GATEWAY=your_gateway_address
DNS1=8.8.8.8
DNS2=8.8.4.4
systemctl restart network
3. Debian / Ubuntu VPS
vi /etc/network/interfacesAnd modify following information:
Then restart network service to update new IP configuration with following command:auto eth0
iface eth0 inet static
address your_ip_address/prefix
gateway your_gateway_address
dns-nameservers 8.8.8.8 8.8.4.4
dns-options rotate
service networking restart