Multiple subnets with relays

Glenn Satchell Glenn.Satchell at
Mon Jan 19 12:02:48 UTC 2009

>Date: Mon, 19 Jan 2009 09:18:24 +0100
>From: "Jessica Meyer" <jessmeyer82 at>
>To: dhcp-users at
>Subject: Re: Re: Multiple subnets with relays
>Dear Simon,
>Thank you for your answer.
>> Congratulations, your config is just what you need (apart from adding
>> a few options like routers etc). The rest is automagic - the server
>> spots that the GIAddr (Gateway Interface Address) field is filled in
>> and uses it to determine which subnet (or shared network) the client
>> is connected to.
>Glad I'm on the right way, _BUT_, as you can see, I've set a
>shared-network for and, but how does DHCPD know to
>give out IPs from this two networks?? I know that if a request comes
>from, DHCPD gives out an address of the range (in
>this case, from to But what I want is that, if
>the first range has no more addresses, DHCPD also gives out addresses
>from the network (even if the relay is Hope I
>could explain it.
>In the end, I will create some shared-networks, but I want to know
>where I can set explicitely which relays get which ranges etc.

Hi Jess

When you create a shared-network, in effect you are telling dhcpd that
it can allocate from any of the ranges within the shared network. It
just so happens that the allocation algorithm uses either the lowest or
highest range first (I forget exactly which, and it may change between
major versions so don't rely on it).

Addresses are allocated on a least recently used basis. However you
have nearly 65000 addresses in each pool, so it will take some time to
"fill one up". Once the pools are well used allocation tends to occur
semi-randomly from all the ranges.

If you want to explicitly put some hosts in one range, and others in a
different range within a shared-network, then you can use classes to
achieve this easily. In the pool you can allow or deny based on the
membership of one or more classes.

See the dhcpd.conf man page and look for the section titled 'CLIENT
CLASSING'. You can use matching on things like mac addres sprefixes,
vendor identifiers, or any other piece of information in the client's

The secret is start simple, and build up the config file as required.

Glenn Satchell     mailto:glenn.satchell at | It's a dog  eat dog
Uniq Advances Pty Ltd | world, and by golly,
PO Box 70 Paddington NSW Australia 2021              | we better make sure
tel:0409-458-580  tel:02-9380-6360  fax:02-9380-6416 | we're the dog.

More information about the dhcp-users mailing list