Configure secondary ip address in centos


We can configure secondary ip address in centos by using the following steps but make sure that you have logged in to the server as root user.

cd /etc/sysconfig/network-scripts

Create the new interface file ifcfg-eth0:1, if its already exist then use ifcfg-eth0:2 and so on for the every new ips.

touch ifcfg-eth0:1

Now open the file ifcfg-eth0:1 and add the following lins as per your ip new ip address.

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=your new ip address
ONBOOT=yes

Similarly you can add other ips on your server and to get the ip up use the ifup command.

About Anant 376 Articles
Senior technical writer