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 delete mailman archives on cPanel using command?

If you have created a mailman mailing list called [email protected] and want to clear it, then...

How to install Softaculous on Linux server with cPanel?

Ioncube loader should be installed and enabled on your Linux machine with cPanel before...

How Do I Check Bandwidth Utilization of VPS?

Windows VPS To check/monitor usage of each Windows VPS, we have installed bandwidth meter tool...

How do I enable apache file and directory indexing in Linux or UNIX?

There are 2 ways to enable apache file and directory indexing. Using Apache config file : You...

How to Install Visual Studio Code on CentOS 7?

Visual Studio Code is a Microsoft Product and an open-source cross-platform code editor. It...

  • 0 Users Found This Useful

Was this answer helpful?