Home / Community / Blog

Setting up PXE booting server.

Set up DHCP server:

On Gargoyle (my dhcp server) router I've add to /etc/dnsmasq.conf:

dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/var/lib/misc/tftpboot

of course you can try to use uci instead, if you know how - I couldn't.

Set up files

Download newest syslinux from Linux kernel site (in my case: syslinux 6.03).

Copy

  • bios/com32/libutil/libutil.c32
  • bios/com32/elflink/ldlinux/ldlinux.c32
  • bios/com32/menu/menu.c32
  • bios/core/pxelinux.0

to /var/lib/misc/tftpboot directory.

Create pxelinux.cfg directory and default file inside:

mkdir /var/lib/misc/tftpboot/pxelinux.cfg/
vi /var/lib/misc/tftpboot/pxelinux.cfg/default

The default file should have content like this:

DEFAULT menu.c32
TIMEOUT 300
ALLOWOPTIONS 0
PROMPT 0

MENU TITLE My new PXE Boot Menu

LABEL BootLocal
MENU LABEL ^Boot Local (HDD)
LOCALBOOT 0

now you should be able to test booting from any computer in local network.

Of course this is dummy example as it can only boot from local disk.

As you can see in logs (using logread command on Gargoule router):

Fri Sep 27 19:25:47 2019 daemon.info dnsmasq-tftp[20876]: sent /var/lib/misc/tftpboot/pxelinux.0 to 192.168.1.163
Fri Sep 27 19:25:47 2019 daemon.info dnsmasq-tftp[20876]: sent /var/lib/misc/tftpboot/ldlinux.c32 to 192.168.1.163
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/44454c4c-3400-1037-8034-b1c04f30354a not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/01-84-2b-2b-bd-47-59 not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0A801A3 not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0A801A not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0A801 not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0A80 not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0A8 not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0A not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C0 not found
Fri Sep 27 19:25:47 2019 daemon.err dnsmasq-tftp[20876]: file /var/lib/misc/tftpboot/pxelinux.cfg/C not found
Fri Sep 27 19:25:47 2019 daemon.info dnsmasq-tftp[20876]: sent /var/lib/misc/tftpboot/pxelinux.cfg/default to 192.168.1.163

My computer tried to find following configs files:

  • his UUID (44454c4c-3400-1037-8034-b1c04f30354a)
  • his MAC address (01-84-2b-2b-bd-47-59) with 01 prefix
  • full IP address (C0A801A3) - C0.A8.01.A3 is equal to 192.168.1.163.
  • 7 larger subnets (by 4 bits) - C0A801A to C.
  • finally default file

You can use it later to per host configurations.

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30