How to add 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.

Related Articles

How to Install NodeBB on a CentOS VPS?

NodeBB is an open source and powerful forum software based on the Node.js. It is very easy to...

Do you have any limits for setting up Cron jobs or schedule tasks?

Windows Shared Hosting Plans:We do not offer cron jobs in Windows shared hosting plans. 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...

How To Install Docker on Ubuntu 18.04?

Docker is a container-based tool used to create, deploy, and run the applications by using...

How to Change LiteSpeed WebServer Port on cPanel?

Please refer to the following steps to change the LiteSpeed WebServer Port on cPanel. Login to...

  • 0 Users Found This Useful

Was this answer helpful?