Tuesday, September 14, 2010

Adding an IP range


Create a file named ifcfg-eth0-range0 in the /etc/sysconfig/network-scripts. Inside this file enter the following:
-----------
IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.110
CLONENUM_START=0

-----------
IPADDR_START: This is the first IP from the address range you want to bind to your ethernet device.
IPADDR_END: This is, of course, the last IP from that address range.
CLONENUM_START: This is the number that will be assigned to the first IP alias interface. For instance, if your Internet interface is eth0 and CLONENUM_START is 0, then this config file will create 100 interfaces starting with eth0:0 (eth0:0, eth0:1, eth0:2 etc) and ending with eth0:100.

NOTE! Be careful if you need to add more ranges of IPs. You'll have to use a proper value for CLONENUM_START. For instance, if you need to add a second range with 100 IPs besides the one above, create a new file called ifcfg-eth0-range1 and set the CLONENUM_START to 101 so an overwrite will be avoided. Also please backup the existing files before editing this.

AFTER THIS DONT FORGET TO RESTART NETWORK
=> service network restart

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews