To add IP address on CentOS server you first have to go to network configuration directory:
Now you have to create a file ifcfg-eth0:1, but if you already have many other IP addresses then you have to add file with next increment for next IP address.
Now add below code in that file:
To reflect the changes you can restart the server or you can run below command:
Code:
/etc/sysconfig/network-scripts
Now add below code in that file:
Code:
DEVICE=eth0:1
BOOTPROTO=static
IPADDR=YOUR_NEW_IP_HERE
ONBOOT=yes
Code:
ifconfig eth0:1 up