Add a range of IP in CentOS

As CentOS and RHEL curse shit-and there are some things they invented quite literate. For example, the addition of a large number of additional IP is quite a nice job. In General, if you need to add a large number of addresses I'd signed a bash script in that period to carry out the operation in question that the hand is not working. Under Centos/RHEL people have figured it out quite nice range file. Basically we create file/etc/sysconfig/network-scripts/ifcfg-eth0-range0. Here replace eth0 with the network adapter name if not eth0. Then add the following content


as the arguments are

  • IPADDR_START – starting IP address
  • IPADDR_END – final address
  • NETMASK – subnet mask
  • CLONENUM_START – numbering to begin network adapter eth0:0 in our case


leave a reply

Your email address will not be published. Required fields are marked *

anti SPAM *