This post does not show a successful outcome in case that’s what you where hoping for.
I was trying to get OpenBSD bootstrapped using the PXEBoot NIC in a server. I decided to use my Mac which has tftp and bootpd installed. This post is quite in depth and technical so if you are game then read on.
The quick and short of it was I turned it all on, and copied my pxeboot image, like this from the Terminal:
sudo apachectl start
sudo service tftp start
sudo cp /Library/WebServer/Documents/pub/OpenBSD/4.4/i386/pxeboot /private/tftpboot/
Then I neeed to setup the bootp server which comes with Internet Sharing. The idea was to add the pxeboot filename needed by OpenBSD (the file copied to tftpboot above) to the bootp (AKA dhcp) server options. The important file here is /etc/bootpd.plist. If this file doesn’t exist when Internet Sharing starts then bootpd will create it, removing it when it stops. But courtesy of Jules.FM “if the file already exists when it starts, the Mac will leave it alone and not overwrite or remove it”. So to add new dhcp options you perform these steps:
- Start Internet Sharing
- Copy the file somewhere safe: “
cp /etc/bootpd.plist /tmp/” - Stop Internet Sharing
- Edit /tmp/bootpd.plist
- Add your required options
- Copy the file back in place: “
sudo cp /tmp/bootpd.plist /etc/” - Start Internet Sharing
Since the Mac bootpd.plist file has no option for “filename” documented and since there appears to be a bug in the bootpd implementation with respect to supplying dhcp_options I added these data options to the bootpd.plist file:
<key>dhcp_option_66</key>
<data>
wKgCAQ==
</data>
<key>dhcp_option_67</key>
<data>
cHhlYm9vdA==
</data>
<key>dhcp_option_93</key>
<data>
AA==
</data>
In RFC2132 (Paragraphs 9.4 and 9.5) it specifies that options 66 and 67 are for the tftp server and boot filename. However the bootpd bug meant I had to encode the string “pxeboot” to hexadecimal “0x707865626F6F74” then Base64 encode it being “cHhlYm9vdA==” and that is way too time consuming to stuff around and try something else everytime the tftp file retrieval fails.
Don’t try using the dhcp_option_66 I had either as it is an encoded IP of my tftp server, not yours.
I got it all going, and the MacBookPro worked as planned, but the bootp server offered a filename of “pxeboot” and the silly Intel 10/100 card decided to fail due to missing files on the tftp server. Many hours later and I figured I should use a network sniffer instead of trying to turn on tftpd logging.
A packet dump showed \377 or 0xff being appended to the filename by the boot client (intel Nic on remote server) when using tftp to request the file. This made the filename “pxeboot” look like “pxeboot\377” in Wireshark’s view of the packet, as discussed here by other pioneers in netbooting.
If I get a full working implementation of dhcpd/tftp/pxe using the Mac – and actually working independent of the intel nic problem on the server, I’ll update this entry or write a complete run down.
Don’t hold your breath though. I rebuilt the OpenBSD server using bsd.rd (being a ramdisk installation) so my need is no longer a driver.

I ran into this same issue with the file pxelinux.0 being requested by
the computer as pxelinux.0377 in a wireshark capture. 377 is octal for
hex 0xff or decimal 255. This was not an Intel NIC. It was a NIC using
a RealTek 8139.
To get around this issue, I did the following in the “/private/tftpboot”
directory.
ln -s pxelinux.0 $(printf “pxelinux.0377″)
This created a symbolic link to pxelinux.0 named pxelinux.0%ff. The
tftpd process handled it without trouble. The machine PXEd just fine.
In the /etc/bootpd.plist file, I just used plain text for the strings
instead of a base 64 encoded hex version.
The rest of the setup process is normal for a tftpboot directory setup
with PXE config files.
Yes, Apple’s bootpd forces you to use data values for DHCP option fields. However I am not sure your problem with the TFTP file name is Apple’s fault. As far as I can see the correct value you should be using for a file name of
pxelinux.0
is
cHhlbGludXguMA==
and for the file name
pxelinux
cHhlbGludXg=
This website http://hogehoge.tk/tool-i/ is a great help.
An alternate method for converting strings only is
echo “pxelinux.o” | openssl enc -base64
Openssl seems to pad out strings whereas other methods do not. This does not seem to make a realworld difference though. Openssl is also less helpful if you are trying to convert hex, IP addresses or unsigned integers.