Add multiple IPs to CentOS

As much as I curse RHEL and CentOS shit, there are some things that are invented quite competently. For example, adding a large number of additional IPs is quite a pleasant task. In general, if I have to add a large number of addresses, I would write a bash script in which to perform the operation in question in a loop that it does not work by hand. При Centos/RHEL хората са го измислили доста приятно range файл. В общи линии създаваме файл /etc/sysconfig/network-scripts/ifcfg-eth0-range0. Here we replace eth0 with the name network adapter if it is not eth0. Then we add the following content


as the arguments are

  • IPADDR_START – home IP address
  • IPADDR_END – final address
  • NETMASK – net mask
  • CLONENUM_START – numbering from which to start the network adapter eth0:0 in our case


Leave a Reply

Your email address will not be published.

Anti SPAM *