LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

How​ ​to​ ​Quickly​ ​Bind​ ​an​ ​IP​ ​Range​ ​to​ ​your​ ​CentOS​ ​Server


In this short, yet informative tutorial, we will be showing you how you can quickly bind a range of IPv4 addresses to your CentOS server.

This also works with any RedHat based system, including Fedora!

Whether you are needing to route a /26 IPv4 range, or a /24 IPv4 range – this method can save you lots of time, instead of binding each IP address manually, or creating hundreds of network
alias files.

In this example, we’ll be binding the IP Range,​ and assuming the first usable IP in this block ( is already binded as the main IP of this node.

First, identify whether your main public network is utilizing ifcfg-eth0​ or ifcfg-eth1​.

For example:

#​ ​cat​ ​/etc/sysconfig/network-scripts/ifcfg-eth0


Create a file /etc/sysconfig/network-scripts/ifcfg-eth0-range0 (change eth0 to eth1 if your
primary public network interface is configured on eth1, in this example, we assume eth0).

#​ ​nano​ ​/etc/sysconfig/network-scripts/ifcfg-eth0-range0


IPADDR_START​ is the first​ IP of the range, in this case, we start at .3, since .2 is already
binded to the main interface. You will want to input the last usable IP of the range on

Additionally, you can use the proper CLONENUM_START​ to not overwrite other aliases that
might already be binded to the server. In the example above, if CLONENUM_START was set to
value “1” the first additional IP it would bind would start at .4, instead of .3.

Once you have configured the ranges of IPs that you wish to bind to your server, you do not
need to reboot the entire server, simply the network interface:

#​ ​service​ ​network​ ​restart

Volia! You’re all set, and you can verify the binded IPs by running ifconfig.

Special thanks to Julian Jin from AlphaRacks for sponsoring this tutorial.  


  1. Thanks a lot man!!! I used to do it the long way…… It works like a charm!

    October 14, 2017 @ 2:50 pm | Reply
  2. Tyler Morris:

    Great method! Thanks for the refresher lol, I remember doing this before but for the life of me couldn’t recall the commands/file names, till now!!

    October 15, 2017 @ 1:13 am | Reply
  3. ppopcn:

    canbe used for centos7 +

    October 16, 2017 @ 8:43 am | Reply

Leave a Reply

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
  • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

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