Setting multiple Static IP addresses on a single network interface is simple.
The steps to add additional IP's to one network card / interface in Centos are as follows:
1.) Login into the server as the root user
2.) Navigate to /etc/sysconfig/network-scripts directory
3.) Assuming that the network interface name is eth0, cp ifcfg-eth0 as ifcfg-eth0:1
4.) Edit the ifcfg-eth0:1 file and change the DEVICE parameter to DEVICE=eth0:1
5.) Change the other parameters in the NEW file such as IPADDR to the new IP address.
6.) Repeat this process for each additional IP but remember to change the interface name each time e.g. ifcfg-eth0:2
After adding your additional IP's restart the network service: service network restart
You can add as many as you want, such as eth0:1, eth0:2 …
In Red Hat based distros (CentOS, Fedora etc.), the interfaces are edited through the directory /etc/sysconfig/network-scritps.
Here we have multiple files, each pointing for a device. For instance, to have 4 additional IP’s on a single ethernet device (totaling 5 addresses) we should have 5 files as follows,
The main device file would be just a standard one, we don’t have to change anything with it.
On the other hand, the ifcfg-eth0:1 file should be similar to this,
This would suffice. Don’t forget to restart your network services after adding the lines (or files) to with your appropriate settings.