Adding additional IPv4 to Ubuntu

This guide is applicable only for KVM based VPSes, for OpenVZ based VPSes please click here

To View Network Gateway and Netmask

To know the gateway and netmask of your IP address, please see this guide http://wiki.crowncloud.net/?viewing_network_gateway_netmask

First, find the main/primary interface name with,

ip a   (or)   ifconfig -a

If the above command shows you something like ens3, then replace eth0 below with ens3.

Edit the interfaces file,

nano /etc/network/interfaces

Add the following into it,

auto eth0:0
iface eth0:0 inet static
address IP_ADDR
netmask NETMASK

Details for IP_ADDR and NETMASK can be found from the VPS control panel located at, https://crownpanel.com

Once the interfaces file is updated,

ifup eth0:0

Should activate up the interface.

Similarly to add more IPs, say another addon IP,

Edit the interfaces file,

nano /etc/network/interfaces

Add the following into it, (Note the eth0:1 this time)

auto eth0:1
iface eth0:1 inet static
address IP_ADDR
netmask NETMASK

Details for IP_ADDR and NETMASK can be found from the VPS control panel located at, https://crownpanel.com

Once the interfaces file is updated,

ifup eth0:1

Done!

Similarly you can add more IPs, just change eth0:1 to eth0:2, eth0:3.. etc


Last Modified: November 22 2018 18:11:13