> On Oct 6, 2016, at 7:24 AM, Peer Janssen <p...@pjk.de> wrote:
>
> But I realized that there must be something in the dhcpd options and/or
> something related to arp resolution, which I didn't grok. So I read some
> more RFCs about pxebooting in relation to dhcp and arp, but finally
> abandoned this problem for now, because it was taking way too much time
> for my current local situation.

So, I just happened across my notes for setting up a PXE server from scratch,
and thought I’d send this for the benefit of anyone trying to set up a PXE
server on OpenBSD 6.0.  Granted, this was written to boot an Alix.2d13 using a
VMware Fusion OpenBSD VM instance on a MacBook Pro, but it shows the important
steps for tftpd and dhcpd.

There are bunches of places on the web that talk about this (usually using a
Linux instance for setting up PXE), but I was amazed that I basically could go
from a freshly installed OBSD6.0 to PXE server in about 5 minutes (depending,
really, on how fast I typed).  I particularly like this set up for testing
builds (I build on the Mac in a VM, use the USB port on the Mac to talk to the
alix board’s console, and use the Mac ethernet port for installation).

And, again, these were my own notes, not really meant for publication, but I
wanted to show how simple it was to set up an OpenBSD PXE server.

Sean

#############################
# Setting up the PXE Server #
#############################

# These notes assume a FRESHLY installed OpenBSD 6.0 system, with no
modifications.
# Primary NIC is connected (bridged) to another network just to get the sets
loaded on it.

* Set up httpd — You need to do this unless you put a router/gateway on the
network.

/etc/httpd.conf:
chroot “/var/www"
server "default" {
        listen on * port 80
}

* Add the sets to the httpd server

mkdir /var/www/htdocs/release
Populate /var/www/htdocs/release/OPENBSD_X_Y (from the release server)

* Set up dhcpd

/etc/dhcpd.conf:
subnet 192.168.100.0 netmask 255.255.255.0 {
        option router 192.168.100.1;
        range 192.168.100.32 192.168.100.127;
        filename "pxeboot";
        next-server 192.168.100.1;
}

* Set up tftpd

mkdir -p /path/to/tftpdir/etc
echo "set tty com0" > /path/to/tftpdir/etc/boot.conf
echo "boot bsd.rd" >> /path/to/tftpdir/etc/boot.conf
cp /path/to/www/htdpcs/release/OPENBSD_X_Y/bsd.rd /path/to/tftpdir
cp /path/to/www/htdpcs/release/OPENBSD_X_Y/pxeboot /path/to/tftpdir

* Set up vic1
* vic1 is an added NIC, Bridged to Ethernet.  The Ethernet port
* is plugged into a switch that the Alix is also plugged into

/etc/hostname.vic1:
inet 192.168.100.1 255.255.255.0 192.168.100.255 description "PXE Net"

chmod 640 /etc/hostname.vic1

* Enable httpd

rcctl enable httpd

* Enable dhcpd

rcctl enable dhcpd
rcctl set dhcpd flags vic1

* Turn on tftpd

rcctl enable tftpd
rcctl set tftpd flags /path/to/tftpdir

* Reboot VM (just to verify everything was set up correctly, not really
necessary;
* you can just bring vic1 up if instead (when you set it up))

* Boot the Alix board, set it to PXE boot (S on startup) and set the board
rate to 9600 or whatever speed you want.
* It should boot into bsd.rd

Reply via email to