Adding a secondary IP to Linux without cPanel

Using ifconfig

If you want to add a secondary IP address to a NIC already in use in Linux, and have that change only temporary. Enter this command:

ifconfig [nic]:0 [IP-Address] netmask [mask] up

An example is shown below

ifconfig eth0:0 netmask up

You need to be root in order to execute that command.

Using IP command

If you prefer to use the ip command instead of ifconfig

ip address add [ip]/[mask-digits] dev [nic]

Here is an example

ip address add dev eth0

With this command you can add more ip address to the same dev NIC, the second is considered as secondary.

  • additional IP, secondary IP, unmanaged, IP
  • 14 Users Found This Useful
Was this answer helpful?

Related Articles

Where is the servers located?

The main servers are located in Los Angeles. We also have backup servers in Las Vegas and round...

How is your web hosting so fast?

To be honest it's not one big thing although there is a couple more expensive things we do to be...

How to flush your DNS cache

Your home computer creates a cache for all DNS settings. It does this to save time each time you...

What is the root login for my new VPS server?

The root login is the same password our system sent you in your welcome email. You just change...

What is the path to PERL?

The path to PERL in PERL script is:#!/usr/local/bin/perl