View Single Post
  #1   (View Single Post)  
Old 25th December 2014
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,131
Default OpenBSD PXE boot and tftpd server setup

The following pxe-boot-prepare.sh script automates the manual steps to setup an OpenBSD box as tftpd(8) server for PXE network installs.

These steps are outlined in the OpenBSD FAQ entry 6.10 - How do I boot using PXE? (i386, amd64)

The FAQ does not mention (yet) that besides an optional /etc/boot.conf the latest incarnations of the OpenBSD installer also try to retrieve an /etc/random.seed. This script generates such a file so the installer can use it.

Features:
  • Check whether it is run with root privileges
  • Makes sure that either 'amd64' or 'i386' architecture is been specified
  • Uses /pxe as directory instead of the dyslexic nightmare /tftpdboot
  • If no trace of tftpd in /etc/rc.conf.local is found, it creates an entry to enable it. You can use then # /etc/rc.d/tftpd start to start the Trivial File Transfer Protocol daemon.
  • It assumes the same box also has a running web server, that serves the installation files from a local directory. This directory is used as source to copy the pxeboot and bsd.rd files into the PXE/TFTP directory.

    Although not being used by the installer, the INSTALL.amd64 or INSTALL.i386 is also copied as reminder for which architecture the files are meant.
  • Creates an /etc/random.seed in the PXE directory.
  • Generates an /etc/boot.conf that enables a serial console.
  • Creates a symbolic link auto_install to pxeboot so you can use autoinstall(8) for automatic installs.
  • Shows how to check if tftpd is running
  • The comment section gives some ideas what type of pf.conf(5) rules you need to pass tftpd traffic and how dhcpd can be configured,
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 25th December 2014 at 05:13 AM.
Reply With Quote