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:
- Create a file '/etc/sysconfig/network-scripts/ifcfg-eth0-range0' based on which ethernet card you are using.
- Add the following lines in the file:
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.