regexp or substring match

Tony Hunter tony at uniserve.com
Tue Jul 20 19:17:55 UTC 2010


On Tue, Jul 20, 2010 at 02:58:46PM -0400, Adam Moffett wrote:
> Could I put a client in a class based on his ethernet MAC address like so?:
> 
> class "A1" {
>       match if hardware ethernet=a:0:3e:d4:60:73;
>     }
> 
> If I can do that, is there a way to match only the first 3 bytes of
> the MAC address, so that I'm assigning a certain ethernet vendor
> code to a class?
> 
> Like something along these lines:
> class "A1" {
>       match if hardware ethernet=a:0:3e:*;
>     }

We've used something very similar to match vendor specific hardware:
class "joohong" { 
	match if binary-to-ascii(16,8,":",substring(option dhcp-client-identifier,0,4)) = "1:0:50:d4" ; 
}

I think the mailing list archives probably contin other similar examples.

> The application would be to assign a private IP to a wireless bridge
> for management purposes, but assign a different IP to customer
> equipment that is plugged into the bridge.  The bridge and the
> device plugged into it both have the same option82 circuit-id and
> remote-id.  I know I could create a "host" for each mac address, but
> there are hundreds of these bridges in the field and new ones are
> added regularly so that would be troublesome to manage.  They are
> however all made by the same vendor, so matching the vendor code to
> a class seems like the easy way out.
> 
> Thanks in advance,
> Adam
> 
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

-- 
Best regards,
Tony





More information about the dhcp-users mailing list