Knowledgebase
Knowledgebase
Adding an IP Address in Ubuntu
Posted by Will Kruss on 30 May 2016 10:58 PM

After you have ordered an extra IP Address through the cPanel, you will need to assign the new IP to the NIC in VPS.

Setting Up Multiple IPs in Ubuntu

After you have ordered an extra IP Address through the control panel (see http://www.vpsblocks.com.au/support/Knowledgebase/Article/View/18/0/how-do-i-add-another-ip-address) you will need to assign the new IP to the NIC in your VPS.

The network config file you need to edit is at: /etc/network/interfaces

auto eth2
iface eth2 inet static
address 192.168.210.100
netmask 255.255.255.0
gateway 192.168.210.1

Adding more IP addresses to those interfaces is as simple as creating an alias, done by duplicating the information for the initial interface and appending a colon followed by 0,1,2,3,etc according to how many aliases are needed, minus the gateway (the initial IPs gateway will be used):

auto eth2:0
iface eth2:0 inet static
address 192.168.210.101
netmask 255.255.255.0

auto eth2:1
iface eth2:1 inet static
address 192.168.210.102
netmask 255.255.255.0

When finished run: /etc/init.d/networking restart

This will activate the changes and make the new IP address live.

(0 vote(s))
Helpful
Not helpful