## FILE GENERATED BY mProv.  Modifications will be overwritten
# Please modify the mProv template.
{% if enableDHCP %}
# dnsmasq configuration for iPXE
# by stefanl@nersc.gov, 2012-12-01

# Borrowed from http://www.heath-bar.com/projects/blog/?p=326
# and http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example

# Important note: The syntax in this file requires dnsmasq 2.53 or above.
# RHEL6 ships with dnsmasq 2.48, which uses older syntax.

### Special DHCP options for iPXE

### Borrowed from http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example
# Boot for iPXE. The idea is to send two different
# filenames, the first loads iPXE, and the second tells iPXE what to
# load. The dhcp-match sets the ipxe tag for requests from iPXE.
# Important Note: the 'set:' and 'tag:!ipxe' syntax requires dnsmasq 2.53 or above.
dhcp-match=set:ipxe,175 # iPXE sends a 175 option.

# the 'dhcp-boot' flags ONLY work on IPv4.  
# load undionly.kpxe for clients not tagged with 'ipxe'.  This gets us an ipxe instance running.
dhcp-boot=tag:!ipxe,undionly.kpxe

# undionly.kpxe issues a second DHCP request and we then serve a dynamic pxe over http
# using Robin Smidsrød's bootstrap method provided at https://gist.github.com/2234639
# dhcp-boot=http://{{ bootserver }}/ipxe/


# if we are booting via IPv4, load the IPv4 config.
dhcp-boot=ipversionrouter.ipxe

# Finally, set our boot method to EFI if booted with EFI
dhcp-match=set:BC_EFICLI, option:client-arch, 7 #EFI x86-64

# and load the ipxe EFI binary to get an ipxe instance.  This will cause us to loop
# back to the entry above to serve up the menu.


# now for some IPv6 stuff
# EFI via IPv6
dhcp-match=set:BC_EFICLI,option6:61,0007
dhcp-match=set:BC_EFICLI,option6:61,0009
dhcp-match=set:BC_EFICLI,option6:61,0011
dhcp-option=tag:ipxe,option6:bootfile-url,tftp://{{ bootserver6 }}/ipversionrouter.ipxe

tag-if=set:BC_EFI,tag:BC_EFICLI, tag:!ipxe
pxe-service=tag:BC_EFI,BC_EFI, "mProv over x86-64 UEFI"
dhcp-boot=tag:BC_EFI,snponly_ipv4.efi
dhcp-option=tag:!ipxe,tag:BC_EFI,option6:bootfile-url,tftp://{{ bootserver6 }}/snponly.efi



{% endif %}