[ previous ] [ next ] [ threads ]
 From:  Stephen Erisman <serisman at serisman dot com>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  PXE Booting: Multiple next-server and filename entries?
 Date:  Mon, 22 Sep 2008 00:01:34 -0500
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.


<                 if ($sm['next-server'])
<                     $dhcpdconf .= "    next-server 
<                 if ($sm['filename'])
<                     $dhcpdconf .= "    filename \"{$sm['filename']}\";\n";

<     $pconfig['nextserver'] = $a_maps[$id]['next-server'];
<     $pconfig['filename'] = $a_maps[$id]['filename'];
<     if ($_POST['nextserver'] && !is_ipaddr($_POST['nextserver'])) {
<         $input_errors[] = "A valid next server IP address must be 
<     }
<         $mapent['next-server'] = $_POST['nextserver'];
<         $mapent['filename'] = $_POST['filename'];
<               <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" 
<                 <tr>
<                   <td colspan="2" valign="top" height="16"></td>
<                 </tr>
<                 <tr>
<                   <td colspan="2" valign="top" class="listtopic">PXE 
<                 </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 
<                     <td width="78%" class="vtable">
<                     <input name="nextserver" type="text" 
class="formfld" id="nextserver" size="20" 
<                     Specify the server from which clients should load 
the boot file.</td>
<                 </tr>
<                 <tr>
<                   <td width="22%" valign="top" 
<                   <td width="78%" class="vtable">
<                     <input name="filename" type="text" class="formfld" 
id="filename" size="20" 
<                     Specify the name of the boot file on the server 
<                 </tr>

-------- Original Message --------
Subject: 	Re: [m0n0wall] PXE Booting: Multiple next-server and filename 
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>


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 
               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:
               <descr>Some Description</descr>
*                <next-server>xx.xx.xx.xx</next-server>
*            </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?


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