How to assign static IP address for Linux VPS

You need to logged in at https://my.centerhop.com with your choosen email address and password then open VNC console

1. CentOS 6.x
vi /etc/sysconfig/network-scripts/ifcfg-eth0
And modify following information:

DEVICE=ifcfg-eth0
ONBOOT=yes
IPADDR=your_ip_address
NETMASK=your_netmask_address
GATEWAY=your_gateway_address

Then restart network service to update new IP configuration with following command:
service network restart

2. CentOS 7.x
vi /etc/sysconfig/network-scripts/ifcfg-eth0
And modify following information:

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

Then restart network service to update new IP configuration with following command:
systemctl restart network

3. Debian / Ubuntu VPS
vi /etc/network/interfaces
And modify following information:

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

Then restart network service to update new IP configuration with following command:
service networking restart
  • 125 Users Found This Useful
Was this answer helpful?

Related Articles

Bandwidth limitation

All Cloud VPS services guaranteed 10Mbps Internet Connection with up to 200Mbps of Shared...

Powered by WHMCompleteSolution