[ previous ] [ next ] [ threads ]
 
 From:  Stephen Erisman <serisman at serisman dot com>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall-dev] PXE Booting: Multiple next-server and filename entries?
 Date:  Mon, 22 Sep 2008 00:06:49 -0500
I noticed that some of the text was wrapping on the diffs below, so here 
they are again as an attachment.

-Steve


Stephen Erisman wrote:
> m0n0wall developers,
>
> Can someone with commit rights please review and submit the following 
> patches (2 changed files).
>
> These changes will allow overriding the DHCP next-server and filename 
> options at a host (staticmap) level, which is very useful for handling 
> PXE clients.
>
> If this doesn't come through correctly, or if there is a better way to 
> submit this please let me know.
>
> Thanks,
> Steve
>
>
>
> /etc/inc/services.inc:
> --------------------------------------------------
> 155,159d154
> <
> <                 if ($sm['next-server'])
> <                     $dhcpdconf .= "    next-server 
> {$sm['next-server']};\n";
> <                 if ($sm['filename'])
> <                     $dhcpdconf .= "    filename 
> \"{$sm['filename']}\";\n";
>
>
>
> /usr/local/www/services_dhcp_edit.php:
> --------------------------------------------------
> 59,60d58
> <     $pconfig['nextserver'] = $a_maps[$id]['next-server'];
> <     $pconfig['filename'] = $a_maps[$id]['filename'];
> 84,86d81
> <     if ($_POST['nextserver'] && !is_ipaddr($_POST['nextserver'])) {
> <         $input_errors[] = "A valid next server IP address must be 
> specified.";
> <     }
> 121,122d115
> <         $mapent['next-server'] = $_POST['nextserver'];
> <         $mapent['filename'] = $_POST['filename'];
> 141,144c134
> <               <table width="100%" border="0" cellpadding="6" 
> cellspacing="0" summary="content pane">
> <                 <tr>
> <                   <td colspan="2" valign="top" 
> class="listtopic">General configuration</td>
> <                 </tr>
> ---
> >               <table width="100%" border="0" cellpadding="6" 
> cellspacing="0">
> 167,190d156
> <                 <tr>
> <                   <td colspan="2" valign="top" height="16"></td>
> <                 </tr>
> <                 <tr>
> <                   <td colspan="2" valign="top" class="listtopic">PXE 
> configuration</td>
> <                 </tr>
> <                 <tr>
> <                   <td width="22%" valign="top" 
> class="vncell">&nbsp;</td>
> <                     <td width="78%" class="vtable">
> <                     These settings are usually only needed with PXE 
> booting and for some VoIP phones.  They can usually
> <                     be left empty.  These settings (if provided) 
> will override any values specified for the whole pool.</td>
> <                 </tr>
> <                 <tr>
> <                   <td width="22%" valign="top" class="vncell">Next 
> server</td>
> <                     <td width="78%" class="vtable">
> <                     <input name="nextserver" type="text" 
> class="formfld" id="nextserver" size="20" 
> value="<?=htmlspecialchars($pconfig['nextserver']);?>"><br>
> <                     Specify the server from which clients should 
> load the boot file.</td>
> <                 </tr>
> <                 <tr>
> <                   <td width="22%" valign="top" 
> class="vncell">Filename</td>
> <                   <td width="78%" class="vtable">
> <                     <input name="filename" type="text" 
> class="formfld" id="filename" size="20" 
> value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
> <                     Specify the name of the boot file on the server 
> above.</td>
> <                 </tr>
>
>
> -------- Original Message --------
> Subject:     Re: [m0n0wall] PXE Booting: Multiple next-server and 
> filename entries?
> Date:     Sun, 21 Sep 2008 22:38:23 -0500
> From:     Stephen Erisman <serisman at serisman dot com>
> To:     Monowall Support List <m0n0wall at lists dot m0n0 dot ch>
> References:     <48D52BEE dot 10804 at serisman dot com>
>
>
>
> Ok...
>
> So I have partially answered my own question.
>
> I was able to verify that the ISC DHCP server does indeed support what 
> I am looking for.
>
> I was able to successfully get the /var/etc/dhcpd.conf file to look 
> the way the dhcp server is expecting by doing the following:
>
> I started by adding the following lines of code:
>               if ($sm['next-server'])
>                   $dhcpdconf .= "    next-server 
> {$sm['next-server']};\n";
>               if ($sm['filename'])
>                   $dhcpdconf .= "    filename \"{$sm['filename']}\";\n";
>
> ...to the /etc/inc/services.inc file at line 156, or right after these 
> lines:
>               if ($sm['ipaddr'])
>                   $dhcpdconf .= "    fixed-address {$sm['ipaddr']};\n";
>
> I then manually modified the config.xml document to have a staticmap 
> entry that looks similar to this:
>           <staticmap>
>               <mac>xx:xx:xx:xx:xx:xx</mac>
>               <ipaddr>xx.xx.xx.xx</ipaddr>
>               <descr>Some Description</descr>
> *                <next-server>xx.xx.xx.xx</next-server>
>               <filename>/some-pxe-filename</filename>
> *            </staticmap>
>
> After uploading the modified .xml file and rebooting m0n0wall, I then 
> uploaded my modified /etc/inc/services.inc file and copied it from the 
> /tmp directory.
> Then I modified a different dhcp entry through the web ui which forced 
> a reload of all the dhcp settings.
> I then downloaded the /var/etc/dhcp.conf file which now contains a 
> section similar to this:
>           host s_lan_10 {
>               hardware ethernet xx:xx:xx:xx:xx:xx;
>               fixed-address xx.xx.xx.xx;
> *                next-server xx.xx.xx.xx;
>               filename "/some-pxe-filename";
> *            }
>
> I also verified that the config.xml file did not get overwritten by 
> modifying other settings through the web ui.
>
> I am still going to look into how to open up editing these fields 
> through the web ui.
>
> When I am done, how do I submit this as a patch to be included in an 
> upcoming release?
>
> Thanks,
> Steve
>
> Stephen Erisman wrote:
>> I have been using m0n0wall's DHCP server to send the 'next-server' 
>> and 'filename' options for a while now.
>> So far I have always been directing all my PXE clients to the same 
>> TFTP server, and the same boot filename (tftpboot/pxelinux.0).
>> I now want to try to PXE boot a FreeBSD client which appears to use a 
>> program called pxeboot instead of pxelinux.0.
>>
>> So, my questions are:
>> 1. Does the DHCP server in m0n0wall support sending a different 
>> 'filename' option by client or by group of clients?
>> 2. If yes, how easy would it be to change the xml config loader to 
>> load the 'next-server' and/or 'filename' options from a staticmap 
>> node and override the root values for that client?
>> 3. What about allowing the edit of these options from the 'Edit 
>> static mapping' page?  (I noticed that the latest 1.3 beta already 
>> allows editing of them from the 'DHCP server' page.)
>> 4. If the above are not possible, does anyone know if the pxelinux.0 
>> program can spawn the pxeboot program, or can is be used to directly 
>> boot FreeBSD?
>>
>> FYI... If the answer to #1 is yes, I may be able to help with 
>> implementing #2 and #3.  I just wanted to get other's thoughts before 
>> jumping in.
>>
>> Thanks,
>> Steve
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
>> For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
> For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: m0n0wall dash dev dash unsubscribe at lists dot m0n0 dot ch
> For additional commands, e-mail: m0n0wall dash dev dash help at lists dot m0n0 dot ch
>
patch.zip (10.7 KB, application/x-zip-compressed)