How to add the IP address in Ubuntu using command?

Sometimes you may require to add the IP Address manually in ubuntu network Interface. Following are the steps to perform in order to add the IP Address manually in Ubuntu.

  1. Login to Ubuntu server via ssh.

  2. Hit the Following Command.

    # nano /etc/network/interfaces
  1. Enter the interface alias eth0:0 as mentioned in below screen-shot. (Note: If you already have interface alias eth0:0, you can add eth0:1 or eth0:2 for additional IP Address)

    #secondary ip address
    auto eth0:0
    iface eth0:0 inet static
    address 1*3.2*8.149.***
    netmask 255.255.255.***

 

  1. Below Command will up the added interface alias within the network.

    # ifconfig eth0:0 1*3.2*8.149.*** up
  1. Restart the network service.

    # /etc/init.d/networking restart
  1. check the newly added IP Address with the below command.

    # ifconfig

That's it. You are done with adding IP Address on Ubuntu server.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to Automate Tasks on a Linux VPS Using Cron?

One of our Linux VPS customers faced an issue wherein his Virtual Machine’s system clock was...

How to run ClamAV scan from SSH in cPanel server?

In this article, we'll discuss how to run ClamAV scan via SSH in cPanel/WHM server. ClamAV is one...

How to reset/renew cPanel/WHM Self-signed Certificate?

You might be receiving an email with subject like “The SSL certificate for “[service like exim,...

How do I connect to Linux VPS through SSH from Linux and Windows OS?

This article will guide you on how to login to Linux VPS through SSH (Secure Shell) from Linux...

How to Upgrade PHP Version in cPanel/WHM Server?

Following article will assist you to upgrade PHP version in cPanel/WHM server. This article is...