Configure isc-dhcpd for static guests (PXE on FreeBSD)

Introduction

After basic configuration of "Diskless Operation with PXE" on FreeBSD (https://www.freebsd.org/doc/handbook/network-diskless.html), I wanted to build config, so that specific machines get specific IPv4 address, and specific rootfs location on tftp server, so that I can have multiple root's on one hard-drive. After a couple of hours (two days really) reading manpage, searching internet and testing random configuration methods, I finally got it. Here's how to.

Steps

My configuration file

option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {
	option subnet-mask 255.255.255.0;
	option routers 192.168.0.1;
	option broadcast-address 192.168.0.255;
	option domain-name-servers 192.168.0.1;
	option domain-name "example.com";
	next-server 192.168.0.1;
	
	host server01 {
		hardware ethernet 08:00:27:13:6B:19;
		fixed-address 192.168.0.20;
		filename "FreeBSD/server01/boot/pxeboot";
		option root-path "192.168.0.1:/b/tftpboot/FreeBSD/server01/";
	}
	
	host server02 {
		hardware ethernet 08:00:27:13:6B:1A;
		fixed-address 192.168.0.21;
		filename "FreeBSD/server02/boot/pxeboot";
		option root-path "192.168.0.1:/b/tftpboot/FreeBSD/server02/";
	}
}
    

Things to look out for

Quick tutorial on how to make rootfs from CD

# mount cdrom
mount_cd9660 /dev/cd0 /mnt

# copy needed sets
cp /mnt/usr/freebsd-dist/{base,kernel,lib32}.txz /b

# create root directory
mkdir /b/tftpboot/FreeBSD/install
cd /b/tftpboot/FreeBSD/install

# untar them
tar xvf /b/base.txz
tar xvf /b/kernel.txz
tar xvf /b/lib32.txz

# unmount cd
umount /mnt