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.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to Install LEMP Stack (Nginx, MariaDB, PHP7.2) on Ubuntu 18.04 LTS?

Nginx, MariaDB and PHP7.2 are called (LEMP). Following are the steps to install LEMP on Ubuntu...

What are the benefits of CloudLinux?

There are numerous advantages and benefits of CloudLinux OS has and we will discuss it in this...

How to List All Files Ordered by Size in Linux?

In Linux, we can list all the files using the ls command. Here, we will share some commands which...

How to install Codeignetor centos 7?

Codeignetor is a PHP framework used to build a web application that is used widely by the...

How to Manage Linux VPS (SSD and Traditional) from VPS Management Portal?

We offer SolusVM VPS management portal with SSD Linux VPS and Ttraditional Linux VPS plans....