Need to bind multiple IP addresses to a network interface?
Here is a nice article titled “How to assign multiple IP addresses to one network interface on CentOS“.
The article from the website Xmodulo explains how to assign multiple IP addresses to a single network interface on CentOS, a practice known as IP aliasing. IP aliasing is useful for various purposes, such as setting up multiple sites on virtual web hosting or maintaining different network connections for distinct purposes. The article outlines that all Linux distributions, including CentOS, support IP aliasing and provides a guide on binding multiple IP addresses to a single network interface on CentOS.
Two primary methods exist to set up IP aliasing on the fly in CentOS. The first method involves using the
ifconfig command. The second method uses the
An example of a series of commands is below:
cd /etc/sysconfig/network-scripts/ cp ifcfg-eth0 ifcfg-eth0:0 cp ifcfg-eth0 ifcfg-eth0:1 cp ifcfg-eth0 ifcfg-eth0:2 ... vi ifcfg-eth0:0
Here is an OLD article on the same topic: