How to add several ranges of IPs?

SupermanInNY

Verified User
Joined
Sep 28, 2004
Messages
419
Hi All,

I have several ranges of IPs, then I need to skip an IP and then add few more ranges, then skipp etc.

How do I go about adding them?

112.150.155.3 --> 112.150.155.29
112.150.155.31 --> 112.150.155.40
112.150.155.50 --> 112.150.155.79


I tried the solution of:

vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0

in it, you'll add the code:
IPADDR_START= 112.150.155.3
IPADDR_END= 112.150.155.40
CLONENUM_START=0

but that solution works only on a full range, no spaces.
Is there a diff syntax that I can use?

112.150.155.30 is on a different server, so it is a problem.

What do I need to do to make sure they get added to the ethernet card automatically when I load the network services?

I tried to copy lines, but it only takes the last set.

IPADDR_START= 112.150.155.3
IPADDR_END= 112.150.155.29

IPADDR_START= 112.150.155.31
IPADDR_END= 112.150.155.40

CLONENUM_START=0


Any pointers?

Thanks,

-Alon.
 
I presume you're writing specifically about a DirectAdmin server :) .

If so, then you shouldn't be doing anything in the sysconfig directory; just let the original OS install start the main IP#.

DirectAdmin automatically adds IP#s, and even deletes them. It uses a script called startips.

Jeff
 
I presume you're writing specifically about a DirectAdmin server :) .

If so, then you shouldn't be doing anything in the sysconfig directory; just let the original OS install start the main IP#.

DirectAdmin automatically adds IP#s, and even deletes them. It uses a script called startips.

Jeff

Hi Jeff,

Thanks for the quick reply.

Yes,. DA box of course and just before your reply,. I got John (of DA) advise, where he suggested that I tweak/reuse the loop-code in the

/etc/init.d/startips


Well,.. just running

. /etc/init.d/startips

Did the trick with no problems at all.
No need to hack anything.
It grabbed the files from the ip.list with no problem and loaded just fine.
That's good enough for me :)

If,. on the other hand I run

service network restart

I loose all the ip that are loaded except the server's main IP.

As such,. I'll be using the . /etc/init.d/startips to start/load the IPs onto the network card.

thanks for the input :)

-Alon.
 
Ouch...I had problems with the service network restart thing and was scratching my head.

Thanks for the startips script :)
 
Back
Top