expanding my ip pools

dave c dhcp at gvtc.drakkar.org
Wed Nov 18 20:10:49 UTC 2015


Hello Leandro,

It looks like today you are not using the subnet declaration as intended. I think it would work 
as well for you to have the subnet match the actual subnets in use on your vlan.

> shared-network Public {
>      subnet 10.10.0.0 netmask 255.255.240.0 {

Here you are defining the netmask as a /20 and then you define pools as if they were a separate 
subnet, complete with their own netmasks and routers.

>
>          #10.10.1.0/24
>          pool {
>              range 10.10.1.2 10.10.1.254;
>              option broadcast-address 10.10.1.255;
>              option subnet-mask 255.255.255.0;
>              option routers 10.10.1.1;
>          }
>

Instead I would use the following:

shared-network Public {
	subnet 10.10.0.0 netmask 255.255.255.0 {
		option broadcast-address 10.10.0.255;
		option subnet-mask 255.255.255.0;
		option routers 10.10.0.11;
	# notice no pool defined as no IP space allocated for DHCP management.
	# likely this is your primary subnet in your vlan if all DHCP requests come from it.
	}

	subnet 10.10.1.0 netmask 255.255.255.0 {
		option broadcast-address 10.10.1.255;
		option subnet-mask 255.255.255.0;
		option routers 10.10.1.1;
		pool {
			range 10.10.1.2 10.10.1.254
		}
	}
	subnet 10.10.2.0 netmask 255.255.254.0 {
		option broadcast-address 10.10.3.255;
		option subnet-mask 255.255.254.0;
		option routers 10.10.2.1;
		pool {
			range 10.10.2.2 10.10.3.254
		}
	}

## etc... with each of what you are calling "pools" today defined as a separate subnet
## inside your shared network.

## Then the two new subnets you are adding would be defined as follows:

	subnet 10.10.96.0 netmask 255.255.248.0 {
		option broadcast-address 10.10.103.255;
		option subnet-mask 255.255.248.0;
		option routers 10.10.96.1;
		pool {
	              range 10.10.96.2 10.10.103.254;
		}
	}
	subnet 10.10.104.0 netmask 255.255.248.0 {
		option broadcast-address 10.10.111.255;
		option subnet-mask 255.255.248.0;
		option routers 10.10.104.1;
		pool {
	              range 10.10.104.2 10.10.104.254;
	          }
		## Btw, I notice that you only defined 253 IPs in this /21 of subnet space
	}	## close the last subnet statement
}	## Eventually you would close the shared-network statememt

I've not tested the above in a dhcpd.conf file so it might have a minor typo, but I believe the 
basic pattern to be correct. Also, by defining each of those subnets as "subnets", you could 
probably drop the option subnet-mask and option broadcast-address statements. The option routers 
is needed. I see from my own configs that I too define the options subnet-mask even though it's 
defined as part of the subnet declaration. Could be stuff I inherited and not needed, but it's 
certainly not breaking anything for me to have it defined... though when I get it wrong inside a 
subnet declaration (forget to edit it when I copy a subnet and edit to a new size) it sets off 
alarms and makes it not load new configs anymore :)

Dave

On 11/18/15 10:24, Leandro wrote:
> Hy guys, I would like to ask about how to expand my pool.
> So far I have a setting working ok, but I need to add a new prefix wich is not continuos and
> does not include the ip source of the dhcp requests.
>
> Requests came from ip 10.10.0.11.
> I need to add two segments:
> 10.10.96.0 /21
> 10.10.104.0 /21
>
> And here is my current share network setting:
>
> shared-network Public {
>      subnet 10.10.0.0 netmask 255.255.240.0 {
>
>          #10.10.1.0/24
>          pool {
>              range 10.10.1.2 10.10.1.254;
>              option broadcast-address 10.10.1.255;
>              option subnet-mask 255.255.255.0;
>              option routers 10.10.1.1;
>          }
>
>          #10.10.2.0/23
>          pool {
>              range 10.10.2.2 10.10.3.254;
>              option broadcast-address 10.10.3.255;
>              option subnet-mask 255.255.254.0;
>              option routers 10.10.2.1;
>          }
>
>          #10.10.4.0/22
>          pool {
>              range 10.10.4.2 10.10.7.254;
>              option broadcast-address 10.10.7.255;
>              option subnet-mask 255.255.252.0;
>              option routers 10.10.4.1;
>          }
>
>          #10.10.8.0/21
>          pool {
>              range 10.10.8.2 10.10.15.254;
>              option broadcast-address 10.10.15.255;
>              option subnet-mask 255.255.248.0;
>              option routers 10.10.8.1;
>          }
>      }
> }
>
>
> ######################################3
> This is what Im planning to do:
>
> shared-network Public {
>      subnet 10.10.0.0 netmask 255.255.240.0 {
>
>          #10.10.1.0/24
>          pool {
>              range 10.10.1.2 10.10.1.254;
>              option broadcast-address 10.10.1.255;
>              option subnet-mask 255.255.255.0;
>              option routers 10.10.1.1;
>          }
>
>          #10.10.2.0/23
>          pool {
>              range 10.10.2.2 10.10.3.254;
>              option broadcast-address 10.10.3.255;
>              option subnet-mask 255.255.254.0;
>              option routers 10.10.2.1;
>          }
>
>          #10.10.4.0/22
>          pool {
>              range 10.10.4.2 10.10.7.254;
>              option broadcast-address 10.10.7.255;
>              option subnet-mask 255.255.252.0;
>              option routers 10.10.4.1;
>          }
>
>          #10.10.8.0/21
>          pool {
>              range 10.10.8.2 10.10.15.254;
>              option broadcast-address 10.10.15.255;
>              option subnet-mask 255.255.248.0;
>              option routers 10.10.8.1;
>          }
>      }
>                                              #####this is what I would add:
>      subnet 10.10.96.0 netmask 255.255.240.0 {
>
>          #10.10.96.0/21
>          pool {
>              range 10.10.96.2 10.10.103.254;
>              option broadcast-address 10.10.103.255;
>              option subnet-mask 255.255.248.0;
>              option routers 10.10.96.1;
>          }
>
>          #10.10.104.0/21
>          pool {
>              range 10.10.104.2 10.10.104.254;
>              option broadcast-address 10.10.111.255;
>              option subnet-mask 255.255.248.0;
>              option routers 10.10.104.1;
>          }
>
>
>      }
>
> }
>
> My concern is that the request ip source is not included in those segments , but should be
> enought that new segments are declared under a shared network statement.
> Other question is , after add those lines and restart service , already granted ips will be
> released ?
> Thanks for you wisdom.
> Leandro.
>
>
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

-- 
Dave Calafrancesco


More information about the dhcp-users mailing list