How to add extra IPs to Ubuntu OS Print

  • 0

How to Add Extra IPs to Ubuntu OS?
If you want to add an extra IP on one NIC (Network Interface Controller) in Ubuntu Linux VPS, you have two options. Either using a temporary IP or using a permanent one.

Adding temporary extra IP:
Enter the Ubuntu terminal
Enter this command to add the temporary extra IP
ifconfig [nic]:0 [IP-Address] netmask [mask] up

An example is shown below

ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 up

Note: This IP is valid until you reboot the system.

Adding Permanent extra IP: This IP won’t be deleted if you reboot the system.
Enter the Ubuntu terminal
Open the ‘/etc/network/interfaces’ file with one editor
nano /etc/network/interfaces

Enter these codes at the end of the file:
auto [NIC]:[n]

iface [NIC]:[n]

inet staticaddress [ip add]

gateway [gate way]

netmask [net mask]

4. For example:
auto eth0:1

iface eth0:1

inet staticaddress 192.168.0.1

gateway 192.168.0.254

netmask 255.255.255.0

To add more IPs just follow the above steps. Just change eth0:1 to eth0:2 and so on

Congratulations now you know how to add extra IPs, Also here is an article about how to add Extra ip to centos.

In order to add extra ip to your VPS Server you can easily order extra ip in your TREJJCOMMS client control panel, and it will be automaticaly will be added to your OS network interface.


Was this answer helpful?

« Back