How to assign staic host entry to one of subnets on shared network?

Glenn Satchell glenn.satchell at uniq.com.au
Mon Dec 13 12:50:43 UTC 2010


On 12/13/10 21:41, Constantin Stefanov wrote:
> Hello.
>
> I have a shared network with three subnets in it. One of them is for
> unknown clients, and two are for known clients (one for NATed clients
> and one for 'real' IP addresses).
>
> I have a 'host' entry for every known client. Now I use 'fixed-address'
> in 'host' entries to point which subnet the clients belongs to. But this
> means that I should assign IP addresses for subnets manually, resolving
> conflicts etc.
>
> I want to make configuration without 'fixed-address' in 'host' entries.
> But still I want to have the possibility to point which 'host' entry
> belongs to which subnet. How can this be done? I can make a pool for
> each subnet, but how can i match clients to the pool?
>

If you create a host entry with no fixed-address then the host will be a 
"known" host, but will get an address dynamically using whatever pools, 
classes and allow/deny you set up.

In this case one way is create a pool and use "allow known hosts" in it, 
and "deny known hosts" in the others.

host abc {
   hardware ethernet ...
}

subnet a.b.c.d netmask 255.255.x.y {
   option ...
   pool {
     range ...
     allow known hosts;
   }
   pool {
     range ...
     deny known hosts;
   }
}

Another way is to use a class with sub-classes. In this case the host 
statements are not required, unless you match something else on known or 
unknown.

class "real" {
   match hardware;
}
class "natted" {
   match hardware;
}
subclass "real" 1:x:x:x:x:x:x;
subclass "natted" 1:y:y:y:y:y:y;
# repeat subclass as required

subnet a.b.c.d netmask .... {
   option ...
   pool {
     range ...
     allow members of "real";
   }
   pool {
     range ...
     allow members of "natted";
   }
   pool {
     range ...
     deny members of "real";
     deny members of "natted";
   }
}

-- 
regards,
-glenn
--
Glenn Satchell                            |  Miss 9: What do you
Uniq Advances Pty Ltd, Sydney Australia   |  do at work Dad?
mailto:glenn.satchell at uniq.com.au         |  Miss 6: He just
http://www.uniq.com.au tel:0409-458-580   |  types random stuff.



More information about the dhcp-users mailing list