Spawning based on agent.remote-id (binary vs ascii)

Glenn Satchell Glenn.Satchell at uniq.com.au
Tue Jan 22 11:57:00 UTC 2008


>Date: Mon, 21 Jan 2008 15:30:34 -0800
>From: Scott Baker <bakers at web-ster.com>
>To: dhcp-users at isc.org
>Subject: Spawning based on agent.remote-id (binary vs ascii)
>
>I have a network that we're limiting to 1 IP address per 
>agent.remote-id:
>
>class "DSL" {
>    spawn with option agent.remote-id;
>    lease limit 1;
>}
>
>This works great, and I can add exceptions to this with something like:
>
>subclass "DSL" 1:1:0:0:a:3:1:a:60:6e:4:e { lease limit 5; }
>
>I have a new piece of equipment that sends its agent.remote-id in 
>ascii format, instead of raw binary like above. I copied the 
>agent.remote-id string exactly as it is out of dhcpd.leases and 
>added an exception:
>
>subclass "DSL" "N41-1-7-2-6-1-1" { lease limit 2; }
>
>This does not appear to work, as the customer gets no available 
>billing. Can I not feed a subclass a string like that? Do I somehow 
>have to give it the binary representation of that? Here's two sample 
>leases from my dhcpd.leases file
>
>Existing binary remote-id:
>
>lease 65.182.251.149 {
>   starts 1 2008/01/21 23:11:02;
>   ends 2 2008/01/22 03:11:02;
>   binding state active;
>   next binding state free;
>   billing subclass "DSL" 01:01:00:00:0a:03:01:0a:69:dc:03:33;
>   hardware ethernet 00:17:31:4e:27:40;
>   uid "\001\000\0271N'@";
>   set ddns-rev-name = "149.251.182.65.in-addr.arpa.";
>   set ddns-txt = "31bab2cdefdb5b4a37be2c0a0d8e4057af";
>   set ddns-fwd-name = "65-182-251-149.dsl.web-ster.com";
>   option agent.remote-id 1:1:0:0:a:3:1:a:69:dc:3:33;
>   client-hostname "cmez-073106";
>}
>
>New ascii string remote-id:
>
>lease 216.105.76.179 {
>   starts 1 2008/01/21 23:12:08;
>   ends 2 2008/01/22 03:12:08;
>   binding state active;
>   next binding state free;
>   billing subclass "DSL" 
>4e:34:31:2d:31:2d:37:2d:32:2d:36:2d:31:2d:31:00;
>   hardware ethernet 00:0f:1f:59:c7:bc;
>   uid "\001\000\017\037Y\307\274";
>   set ddns-txt = "31d99c549a579de390dcc2450c16439616";
>   set ddns-fwd-name = "123-123-76-179.dsl.web-ster.com";
>   option agent.circuit-id "n41-1-vb15-387-vlan8";
>   option agent.remote-id "N41-1-7-2-6-1-1";
>   client-hostname "TOY";
>}
>
>I must be missing something silly...

I can see a null byte on the end of the billing class string, whether
that gets put there by using the quotes, or whether it comes form the
device, I'm not I'm not sure, but try pasting in that long colon
separated string.

subclass "DSL" 4e:34:31:2d:31:2d:37:2d:32:2d:36:2d:31:2d:31:00
  { lease limit 2; }

or put the null in like this perhaps?

subclass "DSL" "N41-1-7-2-6-1-1\000" { lease limit 2; }

regards,
-glenn


More information about the dhcp-users mailing list