How do I add additional IP addresses? [CentOS, Ubuntu, Debian]

=========
CentOS
=========


To add additional IP addresses to your CentOS server you'll need to copy the ifcfg-eth0 or ifcfg-em1 file and rename it to ifcfg-eth0:0 or ifcfg-em1:0. In this tutorial we will use the em1 adapter:
cd /etc/sysconfig/network-scripts
cp ifcfg-em1 ifcfg-em1:0


Once we copied the ifcfg-em1 file and renamed it to ifcfg-em1:0 we can edit the file:
nano ifcfg-em1:0

Edit your file to match this (edit the ADDITIONAL.IP, the gateway and netmask to the details you'll find in the clientarea on the My Services page -> Server or contact support):
DEVICE="em1:0"
BOOTPROTO="static"
GATEWAY="5.200.23.129"

IPADDR="ADDITIONAL.IP"
NETMASK="255.255.255.255"
ONBOOT="yes"
BROADCAST="ADDITIONAL.IP"

Once you edited the file and saved it, you can start the adapter:
ifup em1:0

It can be the connection to your server is discontinued for 5-10 minutes.

If you want to add more IP's, repeat the process above. Rename the the filename to ifcfg-em1:X and set the device name to em1:X.

=========
Debian and Ubuntu
=========


To add an additional IP to debian or ubuntu like systems edit the file interfaces in /etc/network:
nano /etc/network/interfaces

You'll see a file that looks like this:
auto eth0
iface eth0 inet static
  address 192.168.1.1
  netmask 255.255.255.0
  gateway 192.168.1.254


Edit the file to look like this:

auto eth0
iface eth0 inet static
  address 192.168.1.1
  netmask 255.255.255.0
  gateway 192.168.1.254

auto eth0:0
iface eth0:0 inet static
  address 192.168.1.2
  netmask 255.255.255.0

Save the file and bring up the device with this command:
ifup eth0:0

Was this answer helpful?

Also Read

What is RAID?

RAID, or Redundant Array of Independent Disks, is a method for storing data on multiple hard...

What will happen when I reach my bandwidth maximum?

Each dedicated server comes with a bandwidth limit. If you exceeds your maximum monthly...

Will I have root access?

Yes, all dedicated servers come with full root access.

How long does it takes before my server is delivered?

We guarantee that all our standard server configurations will be set up within 1-2 business...

What is the connection speed of my dedicated server?

The most dedicated servers at SKB Enterprise come with 1x a 1Gbit network card and have a network...

Powered by WHMCompleteSolution