Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to chainload ipxe using dnsmasq?
2013-02-05, 21:51 (This post was last modified: 2013-08-20 21:42 by stefanlasiewski.)
Post: #3
RE: How to serve serve bootstrap.ipxe via dnsmasq.conf?
I figured out how to do this, and thought I would share. It's actually pretty simple once you understand how the Dnsmasq configuration.

The solution was actually hiding in Simon Kelley's http://www.thekelleys.org.uk/dnsmasq/doc...nf.example , but requires minor changes to work with iPXE. In addition, Simon's example file uses newer Dnsmasq syntax which doesn't work with the default version of Dnsmasq provided with Red Hat Enterprise Linux 6. The other solutions that I found on the internet didn't work for me due to syntax issues.

This test system runs Scientific Linux 6.x (Similar to RHEL6) on a Parallels VM. You'll see the standard Parallels networks down below.

1. Install dnsmasq 2.53 or newer.

2. (optional) Make a quick edit to /etc/dnsmasq.conf to 'include' files under /etc/dnsmasq.d/ .

Old:
Code:
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
#conf-dir=/etc/dnsmasq.d

New:

Code:
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d

3. Modify the following settings in /etc/dnsmasq.conf as needed (Or `/etc/dnsmasq.d/local-settings.conf`, if you prefer the `dnsmasq.d` approach), as needed.

Some of these options assist in debugging.

Code:
# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
interface=eth1
#bind-interfaces
### Don't forget to open the system firewall!

### General DHCP options
# dhcp-ranges for Parallels VM networks.
#dhcp-range=10.211.55.100,10.211.55.110,24
dhcp-range=10.37.129.101,10.37.129.200,24
# Speeds up dhcp, but also dangerous where another dhcp server exists
dhcp-authoritative
# Log lots of extra information about DHCP transactions.
log-dhcp

### DNS Options
# For debugging purposes, log each DNS query as it passes through dnsmasq.
log-queries

### Tftp Options
enable-tftp
tftp-root=/var/lib/tftpboot
# Make the TFTP server more secure: with this set, only files owned by
# the user dnsmasq is running as will be send over the net.
tftp-secure

4. Here is the magic. Drop the following into /etc/dnsmasq.d/ipxe.conf or the main Dnsmasq configuration file:

Code:
# 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.
# load undionly.kpxe for clients not tagged with 'ipxe'.
dhcp-boot=tag:!ipxe,undionly.kpxe
# undionly.kpxe issues a second DHCP request and we then serve bootstrap.ipxe over http
# using Robin Smidsrød's bootstrap method provided at https://gist.github.com/2234639
dhcp-boot=http://10.37.129.3/bootstrap.ipxe
# Or, simply load your own menu
# dhcp-boot=menu.ipxe

4. A this point, follow Robin Smidsrød's bootstrap method provided at https://gist.github.com/2234639
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to serve serve bootstrap.ipxe via dnsmasq.conf? - stefanlasiewski - 2013-02-05 21:51



User(s) browsing this thread: 2 Guest(s)