clients with no hostname

jeffrey j donovan donovan at beth.k12.pa.us
Thu Jan 19 13:11:45 UTC 2012


On Jan 19, 2012, at 6:16 AM, Glenn Satchell wrote:

>> 
>> thanks for the reply glenn,
>> 
>> I'm a little confused on how to trigger if the hostname is blank. Ive already been able to group by the first characters in the hostname.
>> sample of my config.
>> class "FHS" {
>>         match if substring (option host-name,0,3) = "FHS"
>>          or substring (option host-name,0,3) = "CFF";
>> }
>> 
>> 
>> could i do something like this ?
>> 
>> class "FOO" {
>>         match if substring (option host-name,0,8) = " ";
>> }
>> 
>> 
>> does that look correct ?
> 
> The pick-first-value() function does that for you - it returns the first non-null argument.
> 
> class "FOO" {
>         match if pick-first-value (substring (option host-name,0,8), "something") = "abcdefgh";
> }
> 
> But usually done like this:
> 
> option host-name = pick-first-value (substring (option host-name,0,8), "something");
> 
> and the host-name option will be set to the sub-string if it is non-null, or the value "something" otherwise. Yo can put more choices inhere, or create a string based on the ip or mac address.
> 
> To see if an option is set use exists(), so this would create a class of devices with no host-name set.
> 
> class "FOO" {
>         match if not exists (option host-name);
>         # we don't have a host-name set
> }
> 
> and then permit or deny those classes in the appropriate pools.
> 
> regards,
> -glenn

Greetings
and thanks for the explanation. i'll give it a try.
-j




More information about the dhcp-users mailing list