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 change Magento site URL from phpMyAdmin?

Magento is a widely used E-commerce store management system. In this article, we will show you...

How to upgrade Debian 7 (Wheezy) to 10 (Buster) version?

It is always recommended to upgrade the version to prevent any security vulnerability. You can...

How to Deploy Laravel Application with Nginx on Ubuntu?

Laravel is a PHP Framework and Nginx is a Web-Browser which can be installed on Ubuntu. Nginx is...

How to set File Upload Size limit in Apache?

As we know Apache is an open-source and free web server. Here, we will configure apache to set...

How to check Various cPanel logs like WHM, Apache, MySQL, Email, Error etc?

You can use cPanel to access your Linux hosting account with GUI. It is relatively easier to work...