Class matching based on client host name

Mcwilliams, Rhys (ADP DSI) rhys_mcwilliams at adp.com
Thu May 15 14:16:13 UTC 2008


Hi all,
 
Apologies if this has been asked & answered but I've spent the last few
hours searching through the archives to no avail...
 
Scenario: I have 2 branches each with its own default gateway, DNS
servers etc... (lets call then "br1" & "br2")
The Windows machine names are all prefixed with the branch name (e.g.
br1-john or br2-peter). The users regularly travel between the branches.
The dhcpd.conf will specify a "fixed-address" for each client of their
specific branch based on MAC (this is all up and running already).
 
What I'm trying to achieve is a class match based on the first 4
characters of the users Windows machine name
something like the following
# branch 2 DHCP server
      class "br1-clients" {
                match if (
                  (substring(option host-name,0,4) = "br1-") or
                  (substring(option host-name,0,4) = "BR1-"));
        }
 
# branch 1 DHCP server
      class "br2-clients" {
                match if (
                  (substring(option host-name,0,4) = "br2-") or
                  (substring(option host-name,0,4) = "BR2-"));
        }
 
Then I need a pool on each to assign from based on the class
something like the following
# branch 2 DHCP server (plus all the other usual options like "option
routers" etc local to each site)
     pool {
                        allow members of "br1-clients";
                        allow known-clients;
                        max-lease-time 86400;
                        default-lease-time 43200;
                        range 10.10.10.1 10.10.10.61;
     }
 
# branch 1 DHCP server (plus all the other usual options like "option
routers" etc local to each site)
     pool {
                        allow members of "br2-clients";
                        allow known-clients;
                        max-lease-time 86400;
                        default-lease-time 43200;
                        range 10.10.11.1 10.10.11.61;
     }
 
So what should happen then is that if a user from br1 visits br2 - the
machine name starts with "br1-" and is therefore assigned an IP out of
the 10.10.10 pool.
 
There seems to be a problem with this attempted config as my test
machines are not getting assigned IP's from the pool - it doesn't even
show anything in the log file while one of the machines is trying for an
IP. I'm guessing that my problem lies with the "(substring(option
host-name,0,4) = "br1-")". I'm using that because I found such an
example on the net (it didn't stat whether it work though...) and I
can't find any other option...
 
This is not critical but certainly would make life a whole lot easier if
it is possible as I'd also like to assign such pools for machines in the
workshop being repaired/setup...

Regards
---------------------------------------------
Rhys McWilliams


*********************************************************************
Disclaimer
This message and any attachments are intended only for the use of the addressee(s) and may contain information that is privileged and/or confidential. If the reader of the message is not the intended recipient(s) or an authorized representative of the intended recipient(s), please do not use, copy, distribute this email or its attachments or take action based on them. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
ADP Dealer Services South Africa, incorporated in the UK. Registration No. 1990/005462/10;
*********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20080515/627cee50/attachment.html>


More information about the dhcp-users mailing list