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.
Windows Server 2012
Using cmd.exe:
1 |
netsh interface ipv4 add address "Ethernet" 1.2.3.5 255.255.255.0 |
Using a remote login:
- Open the windows control panel. You can access it from the start menu.
- Click “Network and Internet”.
- Click “Network and Sharing Center”.
- Click “Change adapter settings”.
- Right click on the primary ethernet adapter, and click “Properties”. The “Ethernet Properties” window will open.
- Select “Internet Protocol Version 4 (TCP/IPv4)”, then click the “Properties” button. The “Internet Protocol Version 4 (TCP/IPv4) Properties” window will open.
- Click “Advanced…”. The “Advanced TCP/IP Settings” window will open.
- In the “IP addresses” group, click “Add…”. The “TCP/IP Address” window will open.
- 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.
- Click “Add”. The “TCP/IP Address” window will close.
- Click “OK” on the “Advanced TCP/IP Settings” window. This window will close.
- Click “OK” on the “Internet Protocol Version 4 (TCP/IPv4) Properties” window. This window will close.
- Click “OK” on the “Ethernet Properties” window. This window will close, and your secondary IP address will be configured.
CentOS 6
- Create the file /etc/sysconfig/network-scripts/ifcfg-eth0:1
- Populate the file with the following contents:
1234DEVICE=eth0:1BOOTPROTO=staticIPADDR=1.2.3.5ONBOOT=yes - Activate the alias with the following command:
1ifup eth0:1
Ubuntu 12.04
- Add the following lines in /etc/network/interfaces:
1234auto eth0:0iface eth0:0 inet staticaddress 1.2.3.5netmask 255.255.255.0 - Activate the alias with the following command:
1ifup eth0:0
FreeBSD 10
- Add the following lines in /etc/rc.conf:
1ifconfig_vtnet0_alias0="1.2.3.5 netmask 255.255.255.0" - Run the following command to restart networking:
1/etc/rc.d/netif restart && /etc/rc.d/routing restart