Script to generate DHCP subnets

June 30, 2009 at 17:03:16
Specs: Linux
Hi All, I've browsed the site and haven't found an answer to what I need to do, I have a very large number of /24 subnet declarations I need to generate in my dhcp.conf with a gateway and pool of two IP's in each range. for example:

subnet 10.30.1.0 netmask 255.255.255.0 {
range 10.30.1.1 10.30.1.2;
option routers 10.30.1.254;
}
subnet 10.30.253.0 netmask 255.255.255.0 {
range 10.30.253.1 10.30.253.2;
option routers 10.30.253.254;
}

So I need to increment the 10.30.1.0/24 subnet, allocate the first two IP's from that for the client range, and set the option routers to .254 in the subnet, and pipe it to a file.

I'm sure this is probably a simple matter for anyone with scripting skills, but i'm finding i'm getting nowhere fast with my crap scripting skills. Can anyone give some pointers? Thanks!


See More: Script to generate DHCP subnets

Report •


#1
June 30, 2009 at 17:42:37
http://www.subnet-calculator.com/

How do you know when a politician is lying? His mouth is moving.


Report •

#2
June 30, 2009 at 17:52:08
How does http://www.subnet-calculator.com/ generate a dhcp config based on the criteria in my post? I don't need to calculate subnets, I know the ranges already, as I mentioned, what I need is a generator to create the config file based on the certain recurring parameters. I.e; create subnet declarations for all subnets from 10.10.1.0/24 to 10.99.253.0/24, with .1 and .2 from each range as the client IP's, and .254 in each range as the router, formatted as in the example in my post.

Report •

#3
June 30, 2009 at 18:58:43
Sorry, I copied the wrong URL.

http://en.allexperts.com/q/VB-Scrip...

That's the only thing I can find on it. It may not be exactly what you want but it might give you some ideas.

How do you know when a politician is lying? His mouth is moving.


Report •

Related Solutions


Ask Question