This tutorial explains how to setup an additional IPv4 address on your Cloudpanda VPS. We will assume the following:
1.2.3.4
.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.
Using cmd.exe
:
netsh interface ipv4 add address "Ethernet" 1.2.3.5 255.255.255.0
Using a remote login:
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
toBOOTPROTO=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
.
Create the file /etc/sysconfig/network-scripts/ifcfg-eth0:1
.
Populate the file with the following contents:
DEVICE=eth0:1
BOOTPROTO=static
IPADDR=1.2.3.5
ONBOOT=yes
Activate the alias with the following command:
ifup eth0: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
Activate the alias with the following command:
ifup eth0:0
Add the following lines in /etc/rc.conf
:
ifconfig_vtnet0_alias0="1.2.3.5 netmask 255.255.255.0"
Run the following command to restart networking:
/etc/rc.d/netif restart && /etc/rc.d/routing restart