Add a Secondary IPv4 Address to Your VPS

Modified on: Wed, Feb 4, 2015 at 12:51 pm EST

This tutorial explains how to setup an additional IPv4 address on your Cloudpanda VPS. We will assume the following:

  • The Main IP Address of your VPS is 1.2.3.4.
  • You have purchased an additional IP address through the Cloudpanda control panel, and you were assigned 1.2.3.5.

Regardless of the operating system installed on your VPS, you must reboot the VPS after purchasing a second IPv4 address.

Each example below will configure the secondary IP address to become automatically available, and remain configured even after your server is rebooted. You can test if the IP address is configured by pinging it with the ping utility on your client computer.

Windows Server 2012

Using cmd.exe:

 netsh interface ipv4 add address "Ethernet" 1.2.3.5 255.255.255.0

Using a remote login:

  1. Open the windows control panel. You can access it from the start menu.
  2. Click "Network and Internet".
  3. Click "Network and Sharing Center".
  4. Click "Change adapter settings".
  5. Right click on the primary ethernet adapter, and click "Properties". The "Ethernet Properties" window will open.
  6. Select "Internet Protocol Version 4 (TCP/IPv4)", then click the "Properties" button. The "Internet Protocol Version 4 (TCP/IPv4) Properties" window will open.
  7. Click "Advanced...". The "Advanced TCP/IP Settings" window will open.
  8. In the "IP addresses" group, click "Add...". The "TCP/IP Address" window will open.
  9. Fill in the "IP address" and "Subnet mask" boxes. Use "1.2.3.5" for the IP address and "255.255.255.0" as the subnet mask.
  10. Click "Add". The "TCP/IP Address" window will close.
  11. Click "OK" on the "Advanced TCP/IP Settings" window. This window will close.
  12. Click "OK" on the "Internet Protocol Version 4 (TCP/IPv4) Properties" window. This window will close.
  13. Click "OK" on the "Ethernet Properties" window. This window will close, and your secondary IP address will be configured.

CentOS 6

  1. Change the boot protocol from "dhcp" to "static" on eth0. If you are already using a static binding, you can skip this step. Otherwise, follow these directions:

    • Open /etc/sysconfig/network-scripts/ifcfg-eth0 in a text editor.
    • Change BOOTPROTO=dhcp to BOOTPROTO=static.
    • Add these lines at the end of the file. Substitute "[mainip]", "[netmask]", and "[gateway]" with the values from the "IPv4" tab on your Cloudpanda control panel.

         IPADDR=[mainip]
         NETMASK=[netmask]
         GATEWAY=[gateway]
      
    • Run ifup eth0.

  2. Create the file /etc/sysconfig/network-scripts/ifcfg-eth0:1.

  3. Populate the file with the following contents:

    DEVICE=eth0:1
    BOOTPROTO=static
    IPADDR=1.2.3.5
    ONBOOT=yes
    
  4. Activate the alias with the following command:

    ifup eth0:1
    

Ubuntu 12.04

  1. Add the following lines in /etc/network/interfaces:

    auto eth0:0
    iface eth0:0 inet static
    address 1.2.3.5
    netmask 255.255.255.0
    
  2. Activate the alias with the following command:

    ifup eth0:0
    

FreeBSD 10

  1. Add the following lines in /etc/rc.conf:

    ifconfig_vtnet0_alias0="1.2.3.5 netmask 255.255.255.0"
    
  2. Run the following command to restart networking:

    /etc/rc.d/netif restart && /etc/rc.d/routing restart
    

Get started in the SSD Cloud !