cannot change ip address in pool (fixed question)

Sten Carlsen stenc at s-carlsen.dk
Thu Sep 13 08:50:36 UTC 2012


Looks like the formatting is really confusing here. See below.

On 13/09/12 9:12, Simon Hobson wrote:
>
> This is especially true when we get to your host statements.
>
>
>> #########################################
>> host m69 { hardware ethernet 00:0a:73:f9:e6:3a; fixed-address
>> 172.16.10.69; filename "<http://plik.cm>plik.cm";}
>> class "M069" { match if binary-to-ascii(16, 8, ":", option
>> agent.remote-id) = "0:a:73:f9:e6:3a"; spawn with option
>> agent.remote-id; lease limit 1;}
>> pool { allow members of "M069"; range 172.16.20.69; }
>> ##############################################
>> }
>
> Not only is this hard to read, it's mixing scopes as well.
>
> host m69 {
>   hardware ethernet 00:0a:73:f9:e6:3a;
>   fixed-address 172.16.10.69;
>   filename "plik.cm";}
>   class "M069" {
>     match if binary-to-ascii(16, 8, ":", option agent.remote-id) =
> "0:a:73:f9:e6:3a";
>     spawn with option agent.remote-id; lease limit 1;
>   }
>   pool {
>     allow members of "M069";
>     range 172.16.20.69;
>   }
> }
>
If I take the original text and reformat it, I get this:
#########################################
host m69 {
   hardware ethernet 00:0a:73:f9:e6:3a;
   fixed-address 172.16.10.69;
   filename "<http://plik.cm>plik.cm";
}

class "M069" {
   match if binary-to-ascii(16, 8, ":", option agent.remote-id) =
"0:a:73:f9:e6:3a";
   spawn with option agent.remote-id;
   lease limit 1;
}

pool {
   allow members of "M069";
   range 172.16.20.69;
}
##############################################
}
Other than the formatting and the detail that the host and class are
separate, and the remaining "}" is not belonging here, I fully agree
with you Simon.

I want to suggest that proper formatting can make things clear in many
cases showing proper scopes and other details. Maybe a "beautifier"
would be useful?

So what *exactly* are you trying to achieve with this ?
> You've correctly put the host statement in the global scope, but then
> you've defined a class and pool within it.
> I'm not sure about the class (do these need to be in the global scope
> ?), but the pool really belongs within the subnet.
>
> And there should be no need to have both the class/pool AND a fixed
> address - either one or the other. So either :
>
> host m69 {
>   hardware ethernet 00:0a:73:f9:e6:3a;
>   fixed-address 172.16.10.69;
>   filename "plik.cm";}
> }
>
> or :
>
> class "M069" {
>   match if option agent.remote-id) = 0:a:73:f9:e6:3a;
>   spawn with option agent.remote-id; lease limit 1;
> }
> and
>   subnet 172.16.0.0 netmask 255.255.0.0 {
>     next-server 192.168.0.1;
>     option domain-name-servers 217.30.129.149, 217.30.137.200;
>     option routers 172.16.0.1;
>     option subnet-mask 255.255.0.0;
>     option broadcast-address 172.16.255.255;
>     pool {
>       allow members of "M069";
>       range 172.16.20.69;
>     }
>   }
>
> Ahh, now I've split that up, it becomes clearer. 172.16.10.69 is for
> the device with MAC address 00:0a:73:f9:e6:3a and 172.16.20.69 is for
> the downstream device.
> As you've defined it, I don't think the class would be matched because
> the definition (and pool statement) are within a host statement that
> will not apply to the downstream client.
> By definition, the downstream client will not be the host with MAC
> address 0:a:73:f9:e6:3a, so the host statement will not be matches,
> and nothing inside it will be acted upon.

-- 
Best regards

Sten Carlsen

No improvements come from shouting:
       "MALE BOVINE MANURE!!!"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20120913/524b3cc3/attachment-0001.html>


More information about the dhcp-users mailing list