Add a Secondary IPv4 Address to a VPS

This tutorial explains how to setup an additional IPv4 address on your Vultr 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 Vultr 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.

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 Vultr 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
  • 0 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Seotud artiklid

Choosing an OS: CentOS, Ubuntu, Debian, FreeBSD, CoreOS, or Windows Server

Choosing an OS for your server can be difficult. You're aware that it's important to choose a...

What Ports Are Blocked?

Vultr blocks several ports that are commonly abused for DDOS attacks: TCP & UDP port 17...

Configuring Private Network

If you're assigning a private network to an existing machine (or deploying your own operating...

Configuring Static Networking and IPv6 on CentOS 7

VULTR has recently made changes on their end, and everything should now work fine 'out of the...

How Do I Generate SSH Keys?

An SSH Key allows you to log into your server without needing a password. SSH Keys can be...

Powered by WHMCompleteSolution