Adding bulk amount of additional IP's in CentOS

If we have a dedicated server with Centos 6 or Centos 7 and we need to add a full /24 range of IP's in it, we can do it by adding it as a range by mentioning the start IP and end IP. An example is provided below:

If you own 192.168.1.0/24, and you need to add all of the IP's in that range, we can add it like the following:

  1. Create a file '/etc/sysconfig/network-scripts/ifcfg-eth0-range0' based on which ethernet card you are using. 
    vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0
  2. Add the following lines in the file:

IPADDR_START=192.168.1.3

IPADDR_END=192.168.1.254

NETMASK=255.255.255.255

CLONENUM_START=1

Here you need to replace the start IP and end IP based on what you own. 

If you needed to add first 100 IP's only,   you can set the first IP as 192.168.1.3 and end IP as 192.168.1.102. But make sure that any IP's in between these are not used somewhere else. 

3. Once the configuration is added you can restart the network service or reboot the server. It is better to have IPMI access before doing such changes. 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to add Swap on Centos 7

Introduction One of the easiest ways to make your server more responsive, and guard against...

Common SSH Commands - Linux Shell Commands

  Navigating in UNIX pwd Shows the full path of the current directory ls...