How do I add 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 temporarily. Enter this command:

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

An example is shown below

ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 up

You need to be root 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 192.168.99.37/24 dev eth0

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

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

Related Articles

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

Do you troubleshoot scripts and apps?

Hello,Sorry, but troubleshooting sripts and apps needs to be done by the scipt maker or a...

How to use PHP-CLI

You would call '/usr/local/bin/php' if you need the php-cli binary, and '/usr/bin/php' if you...