Netboot/Server

From Sidvind
Jump to: navigation, search
Netboot
using pxelinux and tftp.

The first steps to have netbooting is making your DHCP server provide the additional options (where the TFTP server is located and what filename to use), having your TFTP server serve all the necessary files and configure pxelinux.

DHCP/TFTP[edit]

(using ISC DHCP server, but getting dnsmasq serving pxe is very similar; consult the documentation)

Code: dhcpd.conf (view, download)

  1. subnet 10.1.2.0 netmask 255.255.255.0 {
  2.   range 10.1.2.50 10.1.2.200;
  3.  
  4.   option domain-name-servers ns.example.net;
  5.   option routers gw.example.net;
  6.   server-name "name.example.net";
  7.   filename "pxelinux.0";
  8. }

"filename" is the name of the file the clients will download from the TFTP server, pxelinux.0 is the default name from syslinux so you might as well keep it. If the TFTP server does not reside on the same machine as DHCP you can use next-server other.example.net; to point it somewhere else.

Next configure a TFTP server of your choice and have it serve a directory, e.g. /var/tftproot.

It is possible to serve different files to different clients, e.g:

 class "auto-00:40:63" {
 	match if substring( hardware, 1, 3) = 00:40:63;
 	filename "other";
 }

Syslinux[edit]

Install syslinux and copy pxelinux.0 and vesamenu.c32 to you TFTP root. Create a directory called pxelinux.cfg and the file pxelinux.cfg/default, that will be where you put the configuration for your pxe environment. vesamenu is used to provide a prettier graphical interface but if thats not what you want you may ignore it (and remove the relevant lines from the config)

Code: pxelinux.cfg/default (view, download)

  1. DEFAULT vesamenu.c32
  2. PROMPT 0
  3. TIMEOUT 50
  4. MENU TITLE Sample netboot
  5.  
  6. LABEL localboot
  7.       localboot 0

This sample will create a pxe netboot which displays the menu with a single entry "localboot" and a 5 second timeout (entered as tenth of seconds). For a full description of the options see the syslinux(1) manpage.

Entries[edit]

Code:

  1. LABEL name
  2.       MENU LABEL Title
  3.       TEXT HELP
  4.          Some additional text
  5.       ENDTEXT
  6.       localboot 0
  • LABEL marks the start of an entry.
  • MENU LABEL is used to give a different (often more verbose) description of the entry (shown when using vesamenu.c32).
  • TEXT HELP is shown to the user when selecting an entry.
  • localboot will continue to boot the system as usual, ignoring pxe.