Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have an existing LAN with a DHCP server already dishing out IP addresses.

For various reasons I cannot replace that server so it will still need to dish out IP addresses.

I've been experimenting with Dnsmasq in Proxy mode to provide PXE boot filenames. Now I have Dnsmasq chainloading iPXE ok, but I found that the problem with Dnsmasq is that in Proxy mode it won't send DHCP options down. So I can't seem to send option 17 to boot iSCSI SAN.

I read somewhere that it's not enabled in the source code. Oh well, so I thought perhaps I should try ISC DHCPD (default version4 with Ubuntu), but I can't find any configuration examples that work as a Proxy.

  1. Does ISC DHCPD even work in Proxy mode? Examples on the web imply patching the source.
  2. What other options do I have?
share|improve this question
    
What type of DHCP server is already on the network? –  ewwhite Aug 9 '12 at 10:39
    
One that's built into a router that I don't have control over. –  Matt Aug 9 '12 at 11:35
    
Use 2 different lan? One for regular dhcp, the other one for pxe boot –  coincoin Aug 18 '12 at 12:16

3 Answers 3

up vote 3 down vote accepted

You might look at building a custom iPXE image with an embedded ipxe script that chainloads whatever you want to see after netbooting (e.g., menu.c32, vesamenu.c32, pxelinux, etc.). The nice thing is that iPXE doesn't need any passed DHCP options at all (e.g., options 66 and 67). What's embedded in the ipxe script will be used instead. It just needs DHCP to assign an IP.

The potential downside to this approach is that you either need to boot off a CD (you can create an ipxe image ISO), mount the ISO inside a VM to boot from it, or, if you do have an existing PXE boot server and are using something like pxelinux and menu.c32/vesamenu.c32 you can put an UNDI image that the ipxe build process will generate. The UNDI version of ipxe can be chain booted from pxelinux and perhaps from other boot loaders.

I'm still trying to figure out how to use dnsmasq as a proxyDHCP server myself. I can get it to boot the ipxe image via proxyDHCP but can't get ipxe to get a DHCP IP address after it loads. From I can tell it's because the iPXE DHCP client is preferring the proxyDHCP as its DHCP server (if that makes sense), which seems odd given what the purpose of the proxyDHCP server is - i.e., to NOT need a DHCP server.

EDIT: Here's a functional proxydhcp setup for dnsmasq (finally figured it out):

In /etc/dnsmasq.d/proxydhcp.conf file included from the main /etc/dnsmasq.conf config (e.g., config line conf-dir=/etc/dnsmasq.d):

port=0  
log-dhcp  
dhcp-match=ipxe,175  
dhcp-option=175,8:1:1  
dhcp-boot=net:ipxe,http://mynetbootserver.domain.com/boot/ipxeboot/${net0/mac}  
dhcp-boot=tag:!Iipxe,ipxe.0  
enable-tftp  
tftp-root=/tftpboot  
dhcp-range=192.168.0.0,proxy,255.255.0.0  
dhcp-range=10.0.0.0,proxy,255.0.0.0  
dhcp-range=172.16.0.0,proxy,255.255.0.0  
pxe-service=net:#ipxe,x86PC,"My Cool Netboot Processes",ipxe-native  

Works nicely with another DHCP server in the network. My VMs boot picking up the proxyDHCP options passed to the DHCP client instead however I assume (perhaps incorrectly?) that the client WILL pick any PXE-related boot options (e.g., 66, 67) up from a DHCP server if it's already configured to provide those options.

Note the use of all RFC1918 IP space in the proxy statements. There doesn't seem to be any issue doing this - i.e., no visible interference with an existing DHCP server because of course this is merely a proxy not an authoritative DHCP server for a subnet. Also the ipxe options are not specifically required to support proxydhcp but just an example based on how I'm choosing to use it; i.e., use proxydhcp to pass ipxe bootstrap information along.

In short, proxyDHCP is a very nice way to non-invasively implement PXE netbooting in environments where you are not technically or administratively capable of modifying the DHCP server(s) running in your environment.

share|improve this answer
    
The problem with dnsmasq is that it really needs to be authoritative. Then it all works. If it's not you run into problems i.e. it works part way. –  Matt Aug 28 '12 at 22:03
    
And this is what I did in the end. Get dhcp to offer up a boot filename i.e. undionly.kpxe (iPXE) with an embedded script. –  Matt Jun 6 '13 at 5:14
    
Sorry I know an old comment and perhaps I am not grasping the context but FWIW I have not found the statement "the problem with dnsmasq is that it really needs to be authoritative" to be true, at all. I've run dnsmasq in proxyDHCP mode in parallel with MS DNS, ISC DHCP, generic home router box DHCP (Linksys), IOS DHCP, and Infoblox DHCP and dnsmasq has happily worked without issue. –  Jim Antoniou Sep 2 at 21:12
    
Jim, dnsmasq works ok when you just do a regular boot. But I needed to send some other bits of info down the wire that only come via the primary dhcp server not the proxy. –  Matt Sep 2 at 21:31
    
Gotcha. Didn't understand the context then obviously. –  Jim Antoniou Sep 9 at 0:19

Does isc dhcpd even work in proxy mode?

No, it does not. Use dhcrelay instead - it is distributed as part of dhcpd by ISC, but most distros (including Ubuntu) carry it as a separate package. This however would not allow you to add, modify or filter any options - the very idea of DHCP is that you define this kind of things centrally on the server only, the relays are just "dumb" forwarders. It may well be that because you are trying to work around a concept and not just an implementation, you are running into all kinds of trouble.

share|improve this answer

No, the ISC DHCPD server doesn't support ProxyDHCP mode. We've had an idea for a GSoC project in the iPXE community for some while to implement that, but no student has been willing to take up the task yet. On the other hand, dnsmasq can be configured to work in ProxyDHCP mode, but it's configuration is purely static. We have an idea for this year's GSoC to extend dnsmasq so that it can send DHCP requests to a web server that can take care of the logic and send back a response to dnsmasq, which should then relay this to the ProxyDHCP client. You can read more about this at this page: http://ipxe.org/gsoc

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.