How do I manually add a second IP address to my CentOS installation?

If you have purchased a second ip address for your CentOS installation and need to add the new static ip address, follow these simple steps:

You will first need to identify the current interface name, which will likely be either eth0 or ens3, you can find out by running the following command on the server:

ip link show

If you see eth0 referenced:

Create the following file:

/etc/sysconfig/network-scripts/ifcfg-eth0:1

And inside this file add the following contents, be sure to replace 123.45.67.89 with your new ip address:

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=123.45.67.89
NETMASK=255.255.255.0
ONBOOT=yes

Once completed, activate this and restart networking with the following commands:

ifup eth0:1
service network restart

 

If you see ens3 referenced:

Create the following file:

/etc/sysconfig/network-scripts/ifcfg-ens3:1

And inside this file add the following contents, be sure to replace 123.45.67.89 with your new ip address:

DEVICE=ens3:1
BOOTPROTO=static
IPADDR=123.45.67.89
NETMASK=255.255.255.0
ONBOOT=yes

Once completed, activate this and restart networking with the following commands:

ifup ens3:1
service network restart

If you have any trouble, please do not hesitate to reach out to [email protected]

 

 

  • centos, IP, network
  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

How Do I Install a GUI with CentOS 6?

If CentOS has already been installed without a graphical interface, you can install this with the...

How do I add a second IP address within Virtualmin?

Once our support staff has allocated a secondary IP address to your virtual server, you can add...

Install Wine on CentOS 6 64bit

Disclaimer: These instructions are one method for installing the recommended packages for wine...

PHP and Apache Settings with Virtualmin

The PHP configuration can be edited via Webmin here:Webmin->Others->PHP configuration...

Where can I find the MySQL root password for the Webuzo Stack?

The default MySQL root password for the Webuzo Stack/Softaculous is found in this...