Adding additional IPv4 to CentOS

This guide is applicable only for KVM based VPSes, for OpenVZ based VPSes please click here

To View Network Gateway and Netmask

To know the gateway and netmask of your IP address, please see this guide http://wiki.crowncloud.net/?viewing_network_gateway_netmask

Configuring additional IPv4

Edit the interfaces file,

nano /etc/sysconfig/network-scripts/ifcfg-eth0:1

Add the following into it,

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=IP_ADDRESS
GATEWAY=GATEWAY
NETMASK=NETMASK
ONBOOT=yes

Once the interfaces file is updated,

ifup eth0:1

Should activate up the interface with the new additional IP

To add more IPs,

  1. change ifcfg-eth0:1 to ifcfg-eth0:2, ifcfg-eth0:3, ifcfg-eth0:4 etc
  2. change DEVICE=eth0:1 to DEVICE=eth0:2, DEVICE=eth0:3, DEVICE=eth0:4 etc

in the files