Recent days we get the announcement about releasing Raspberry Pi 3. Those of you who play with embedded systems or just try to make things probably still got good old Raspberry Pi (1). Because during time old platforms loose value as potential candidate for new projects I decided to sacrifice my old RPi and make test server from it.

One of my customer required testing his software against PXE server with various configurations. I realized that using my home network with my TP-Link router I have no way to create such configuration on server machine I usually use. I would need to connect directly to server and with one Ethernet port this was not the solution for me. My other platforms like A20 boards, Odroid or RPi2 are occupied by some projects. I recall that I have old RPi that can be used for that purpose.

Configuration described below is very limited because it test just PXE booting, there is no outside world connection. This connection can be added by adding wifi dongle to Raspberry Pi and modifying iptables and routing.

Prerequisites

  • download recent Raspberry Pi image and flash it to SD card. I used Raspbian Jessie Lite.
  • if you don’t have free keyboard and HDMI monitor use UART to connect serial console – you can use this post, if you don’t konw how to connect it
  • flash recent iPXE to your hardware or use what is already provided by vendor

Raspbian Jessie Lite – initial setup

Setup TFTP

Install server TFTP:

Change configuration according to your needs. My looks like that:

Download netboot files for Debian, which we will use for testing purposes:

Unpack netboot package in /srv/tftp:

Setup udhcpd

Install udhcpd and remove conflicting packages:

At the end of /etc/udhcpd.conf add:

You can also assign client MAC to given IP address by adding:

Comment DHCPD_ENABLE in /etc/default/udhcpd:

Change eth0 configuration to static IP:

Then reboot device and connect your PXE client device.

Testing PXE server

When device boot press Ctrl-B to enter iPXE shell. If you cannot enter shell please replace iPXE with recent version using this instructions.

Entering iPXE you should see something like that:

First let’s configure interface:

And boot Debian installer:

Summary

It took me some time to put this information together an correctly run this server, so for future reference and for those confused with udhcpd and other tools configuration this post should be useful. Thanks for reading and as always please share if you think this post is valuable. If anything is not clear or I messed something please let me know in comments.