dhcp for 2 subinterface (Simon Hobson)

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Oct 22 18:06:28 UTC 2010

Evans Lin ( ó-â¿ï¤ ) wrote:

>My server need to release two sub bundle in the 
>same group ( &,
>  but the broadcast will only appear
>subbundle-a corresponding to its own 
>"a.mac.list", subbundle-b corresponding to their 
>I want to know if you can do: When "b.mac.list " 
>mac up to use gw discover , the 
>server must offer 10.106.0.x , but not 
>10.10.20.x ...

OK, if you want my help, don't go out to annoy me 
! Bottom post (ie put your text BELOW whatever 
you quote) and trim stuff that isn't relevant (in 
this case the other 15k of the days messaeg 
digest !) - I've already pointed that once. 
That's just good etiquette. If the help you want 
isn't worth just one minute of your time, why 
should it be worth five minutes of mine ?

It's been discussed many times on the list, and 
there are several ways to achieve what you want - 
which you use depends on various factors.

For example, is this a one-off thing (ie there is 
only this one network you want to do this in)
or will this need to be done with multiple networks ?

If you do want to do it in multiple networks, 
will they all use the same split of guests ? Ie 
will they all use the same a.list and b.list ?

What do you want to happen to devices not listed ?

Do you actually need to do this ? What are you 
trying to achieve ? It's important to ask as you 
are making a lot of extra work for yourself which 
may not be necessary.

Method 1
Define those hosts you want in one subnet with host declarations, like this :

shared-network "foo" {
   subnet ... {
     pool {
       range a.b.c.w a.b.c.x ;
       allow known-hosts ;
   subnet d.e.f.0 ... {
     pool {
       range d.e.f.y d.e.f.z ;
       deny known-hosts ;
host "foo-1" { hardware ethernet aa:bb:cc:dd:ee:ff ; } ;
host ...

In this method, any device with a host statement 
will get a lease from the first subnet, all 
others will get a lease from the second subnet. 
You need to maintain a list of hosts, and all 
shared networks would need to use the same split 
between clients.

Method 2
Use classes - see the man section on classes and subclasses

class "a-list" { match hardware ; }
class "b-list" { match hardware ; }

subclass "a-list" 1:aa:bb:cc:dd:ee:ff ;
subclass "b-list" 1:uu:vv:ww:xx:yy:zz ;
subclass "a-list" ...

shared-network "foo" {
   subnet ... {
     pool {
       range a.b.c.w a.b.c.x ;
       allow members of "a-list" ;
   subnet d.e.f.0 ... {
     pool {
       range d.e.f.y d.e.f.z ;
       allow members of "b-list" ;

You can of course just omit the b-list and use 
allow/deny as in the first option. You can also 
use different classes for different networks.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the dhcp-users mailing list