<div dir="ltr">Too be more clear, here's my dhcpd.conf file and includes :<div><br></div><div>FILE dhcpd.conf :</div><div>include "/etc/dhcp/dhcpd_voip.conf";</div><div>subnet 192.168.2.0 netmask 255.255.255.0 {<br>    option routers 192.168.2.1;<br>    pool {<br>        range 192.168.2.100 192.168.2.200;<br>        include "allowed-members.include";<br></div><div>    }</div><div>}</div><div><br></div><div>################</div><div>FILE allowed-members.include :<br></div><div>.....</div><div>allow members of "Aastra6730i";<br>allow members of "Aastra6731i";<br>allow members of "Aastra6739i";<br>allow members of "Aastra6751i";<br></div><div>.....</div><div>################<br></div><div>FILE dhcpd_voip.conf :</div><div>contains include of classes :</div><div>include "/etc/dhcp/dhcpd_voip/aastra.conf"<br></div><div>....</div><div>################<br></div><div>FILE /etc/dhcp/dhcpd_voip/aastra.conf :</div><div>.....</div><div>class "Aastra6730i" {<br>    match if option vendor-class-identifier = "AastraIPPhone6730i";<br>    log(concat("[", binary-to-ascii(16, 8, ":", hardware), "] ", "BOOT Aastra 6730i"));<br>    option tftp-server-name = concat(config-option VOIP.http-server-uri, "/tftpboot/");<br>}<br></div><div>class "Aastra6757i" {</div><div>     ...</div><div>}</div><div>.....</div><div>################<br></div><div><br></div><div>The error I get with this config is :</div><div><br></div><div>allowed-members.include line 6: expecting allow/deny key<br>allow members<br>       ^<br>allowed-members.include line 6: expecting a parameter or declaration<br>allow members of "Aastra6731i";  <br>                              ^  <br>allowed-members.include line 8: expecting allow/deny key<br>allow members<br>       ^<br>allowed-members.include line 8: expecting a parameter or declaration<br>allow members of "Aastra6751i";  <br>                              ^  <br></div><div><br></div><div><br></div><div>I get one error per class</div><div>Regards,</div><div>Cédric</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 10 nov. 2021 à 14:23, BASSAGET Cédric <<a href="mailto:cedric.bassaget.ml@gmail.com">cedric.bassaget.ml@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Peter,<div>the include line in your example is commented. I think you will get an error if you un-comment it :)</div><div>Regards</div><div>Cédric</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 9 nov. 2021 à 15:36, Peter Davies <<a href="mailto:peter.watson.davies@outlook.com" target="_blank">peter.watson.davies@outlook.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Cèdric,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
   Have you tried having each shared-network/subnet in its own include file.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Then include a file with "members of" statements within that?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
ie:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px">
<span><span>dhcpd.conf:</span></span>
<div><span>         class </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span> {</span></div>
<div><span>         match pick-first-value (option dhcp-client-identifier, hardware)</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>       }</span></div>
<br>
<div><span>       class </span><span style="color:rgb(163,21,21)">"allocation-class-2"</span><span> {</span></div>
<div><span>         match pick-first-value (option dhcp-client-identifier, hardware)</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>       }</span></div>
<br>
<div><span>        allow members of </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>        allow members of </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span style="color:rgb(0,128,0)">;</span></div>
<br>
<div><span>       class </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span> {</span></div>
<div><span>         match pick-first-value (option dhcp-client-identifier, hardware)</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>       }</span></div>
<br>
<div><span>       class </span><span style="color:rgb(163,21,21)">"allocation-class-2"</span><span> {</span></div>
<div><span>         match pick-first-value (option dhcp-client-identifier, hardware)</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>       }</span></div>
<div><span>       subclass </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span> 1:8:0:2b:4c:39:ad</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>       subclass </span><span style="color:rgb(163,21,21)">"allocation-class-2"</span><span> 1:8:0:2b:a9:cc:e3</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>       subclass </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span> 1:0:0:c4:aa:29:44</span><span style="color:rgb(0,128,0)">;</span></div>
<br>
<div><span>      include </span><span style="color:rgb(163,21,21)">"subnet-1.include"</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>...</span></div>
<br>
<div><span>subnet-1.include:</span></div>
<div><span>shared-network </span><span style="color:rgb(163,21,21)">"SN1"</span><span> {</span></div>
<div><span>  subnet 10.0.0.0 netmask 255.255.255.0 {</span></div>
<div><span>    option routers 10.0.0.1</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>    pool {            </span></div>
<div><span>           </span><span style="color:rgb(0,128,0)">#include "access-1.include";</span></div>
<div><span>           range 10.0.0.10 10.0.0.254</span><span style="color:rgb(0,128,0)">; } }</span></div>
<div><span>}</span></div>
<br>
<div><span>access-2.include:</span></div>
<div><span>allow members of </span><span style="color:rgb(163,21,21)">"allocation-class-1"</span><span style="color:rgb(0,128,0)">;</span></div>
<div><span>allow members of </span><span style="color:rgb(163,21,21)">"allocation-class-2"</span><span style="color:rgb(0,128,0)">;</span></div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
This appears to work</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Kind Regards Peter</div>
 </div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="gmail-m_-7292817898463914236gmail-m_-1611890633401422262Signature">
<div></div>
</div>
</div>
<div id="gmail-m_-7292817898463914236gmail-m_-1611890633401422262appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-7292817898463914236gmail-m_-1611890633401422262divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> dhcp-users <<a href="mailto:dhcp-users-bounces@lists.isc.org" target="_blank">dhcp-users-bounces@lists.isc.org</a>> on behalf of BASSAGET Cédric <<a href="mailto:cedric.bassaget.ml@gmail.com" target="_blank">cedric.bassaget.ml@gmail.com</a>><br>
<b>Sent:</b> 09 November 2021 09:21<br>
<b>To:</b> <a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a> <<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a>><br>
<b>Subject:</b> include in pool</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hello.
<div>I have to configure a dhcp server wich will act as master for dozens of relays.</div>
<div>My basic pool config includes a lot of "allow members of" statements, like this :</div>
<div><br>
</div>
<div><br>
</div>
<div>subnet 192.168.2.0 netmask 255.255.255.0 {<br>
    option routers 192.168.2.1;<br>
    #option domain-name-servers 192.168.2.1;<br>
    #option bootfile-name = "snom821.htm";<br>
    pool {<br>
        range 192.168.2.100 192.168.2.200;<br>
        ### Assign who is going to use this pool<br>
        allow members of "voip-mac-address-prefix";<br>
        # allow localhost for NRPE<br>
        # allow members of "localhost";<br>
        # Aastra<br>
        allow members of "Aastra6730i";<br>
        allow members of "Aastra6731i";<br>
        allow members of "Aastra6739i";<br>
        allow members of "Aastra6751i";<br>
        allow members of "Aastra6753i";<br>
        allow members of "Aastra6755i";<br>
        allow members of "Aastra6757i";<br>
        # Snom<br>
        allow members of "Snom300";<br>
        allow members of "Snom320";<br>
        allow members of "Snom360";<br>
        allow members of "Snom370";<br>
        allow members of "Snom820";<br>
</div>
<div>       ....</div>
<div>     }</div>
<div>}</div>
<div><br>
</div>
<div>As I have to create dozens of pools, I tried to put all these "allow members of ..." in a file called "allowed_members.include", and replace my pool def by :</div>
<div><br>
</div>
<div>subnet 192.168.2.0 netmask 255.255.255.0 {<br>
    option routers 192.168.2.1;<br>
    pool {<br>
</div>
<div>        include "path/to/allowed_members.include";</div>
<div>    }</div>
<div>}</div>
<div><br>
</div>
<div><br>
</div>
<div>but it does not work, it throws a config error when testing config.</div>
<div><br>
</div>
<div>So my questions are :</div>
<div>- is there a way to do an "include" inside a pool ?</div>
<div>- is there another way to declare multiple pools for each relay ? (all relays will have the same config)</div>
<div><br>
</div>
<div>The aim of this is to have a small and comprehensible dhcpd.conf file.</div>
<div><br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Cédric</div>
<div><br>
</div>
</div>
</div>
</div>

_______________________________________________<br>
ISC funds the development of this software with paid support subscriptions. Contact us at <a href="https://www.isc.org/contact/" rel="noreferrer" target="_blank">https://www.isc.org/contact/</a> for more information.<br>
<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
</blockquote></div>
</blockquote></div>