You've found the Delphinus Wiki. » Delphinus Blog » OpenWRT dnsmasq.conf for gPXE

OpenWRT dnsmasq.conf for gPXE

Last modified by Quentin Conner on 2011/11/13 19:22

Apr 06 2011

Using OpenWrt backfire version 10.03 and /etc/dnsmasq.conf, a MAC-address-based configuration approach enables diskless network boot using gPXE and iSCSI.

Note that OpenWrt backfire version 10.03.1 won't work with the configuration below.  10.03 bundled dnsmasq 2.52-2.  10.03.1 bundles 2.55-6.

gPXE is the new generation of Etherboot, a network boot PROM.
gPXE has iSCSI support via BIOS 0x80 traps.  I played with pxelinux also; it has nice menu capabilities but no iSCSI.  I ended up putting pxelinux on a USB flash drive and using gPXE for diskless PC network booting.

The idea is to define a generic tag that tries to iSCI boot from a bogus IP address ta.rg.et.ip and then define unique tags for each computer that point to a unique iSCSI volume on your iSCSI target.

In my example below, two computers ECS and SLI are identified by their ethernet mac address and tagged as ECS or SLI.  The dnsmasq dhcp-option net:tag then points to the iSCSI target and volume.

My /etc/dnsmasq.conf excerpt:

# An example of dhcp-boot with an external TFTP server: the name and IP
# address of the server are given after the filename.
# Can fail with old PXE ROMS. Overridden by --pxe-service.
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
#dhcp-boot=/pxelinux.0,pollux,192.168.1.19

# required by old versions of gPXE (e.g. the one that comes with OracleVM)
dhcp-no-override

# MAC-specific tags
dhcp-mac=net:ECS,00:14:aa:bb:cc:dd       # ECS mobo / Socket AM2 Athlon
dhcp-mac=net:SLI,00:11:bb:cc:dd:ee       # Asus A8N-SLI mobo forcedeth / Socket 939 Athlon X2

dhcp-match=gpxe,175            # tags the request with net:gpxe if the gPXE option was supplied in DHCP request
dhcp-option=175,8:1:1          # turn on the keep-san option to allow iSCSI-capable OS installation

dhcp-option=net:gpxe,17,"iscsi:ta.rg.et.ip::::iqn.yyyy-mm.reversed-domain-name:identifierTBD"
dhcp-option=net:ECS,17,"iscsi:192.168.1.99::::iqn.1986-03.com.sun:02:aaaabbbb-cccc-dddd-eeee-12345678abcd"
dhcp-option=net:SLI,17,"iscsi:192.168.1.99::::iqn.1986-03.com.sun:02:12344321-2345-6789-abcd-abcddcba1234"

# Last match wins?
#dhcp-boot=pxelinux.0                  # ONLY SET IF want gPXE to run script or chain-load pxelinux
dhcp-boot=net:#gpxe,gpxe.0             # Here #gpxe means 'not gpxe': i.e. the tag is not set        
#dhcp-boot=net:ECS,pxelinux.0
#dhcp-boot=net:ECS,sanboot-test.gpxe   # run gpxe script
Tags:
Created by Quentin Conner on 2011/04/06 20:49

This website content is not licensed to you. All rights reserved.
Delphinus Wiki - XWiki Enterprise 2.7.33656 - Documentation