RFC 5071

Dynamic Host Configuration Protocol Options Used by PXELINUX

๐Ÿ“… published December 2007, from ietf

RFC 5071 ๐ŸŽ€ Dynamic Host Configuration Protocol Options Used by PXELINUX

Okay bestie, this is RFC 5071 ๐Ÿ’– and it's called Dynamic Host Configuration Protocol Options Used by PXELINUX. It came from the Network Working Group and was written by D. Hankins at ISC ๐Ÿ‘‘. It's Category: Informational ๐Ÿ“š and it's dated December 2007 ๐ŸŒธ. The header doesn't list anything it obsoletes or updates, so it isn't replacing or changing any other RFC ๐Ÿ™ˆ.

Status of This Memo โœจ

This memo provides information for the Internet community. It does not specify an Internet standard of any kind, and distribution of this memo is unlimited ๐Ÿฆ‹.

Abstract ๐Ÿ’œ

Basically, this document is about how PXELINUX uses some DHCP Option Codes numbering from 208-211 ๐Ÿงš.


Table of Contents ๐Ÿ—‚๏ธ

1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
2.  Terminology  . . . . . . . . . . . . . . . . . . . . . . . . .  4
3.  MAGIC Option . . . . . . . . . . . . . . . . . . . . . . . . .  4
  3.1.  Description  . . . . . . . . . . . . . . . . . . . . . . .  4
  3.2.  Packet Format  . . . . . . . . . . . . . . . . . . . . . .  5
  3.3.  Applicability  . . . . . . . . . . . . . . . . . . . . . .  5
  3.4.  Response to RFC 3942 . . . . . . . . . . . . . . . . . . .  5
4.  Configuration File Option  . . . . . . . . . . . . . . . . . .  5
  4.1.  Description  . . . . . . . . . . . . . . . . . . . . . . .  5
  4.2.  Packet Format  . . . . . . . . . . . . . . . . . . . . . .  6
  4.3.  Applicability  . . . . . . . . . . . . . . . . . . . . . .  6
  4.4.  Response to RFC 3942 . . . . . . . . . . . . . . . . . . .  6
  4.5.  Client and Server Behaviour  . . . . . . . . . . . . . . .  6
5.  Path Prefix Option . . . . . . . . . . . . . . . . . . . . . .  7
  5.1.  Description  . . . . . . . . . . . . . . . . . . . . . . .  7
  5.2.  Packet Format  . . . . . . . . . . . . . . . . . . . . . .  7
  5.3.  Applicability  . . . . . . . . . . . . . . . . . . . . . .  7
  5.4.  Response to RFC 3942 . . . . . . . . . . . . . . . . . . .  8
  5.5.  Client and Server Behaviour  . . . . . . . . . . . . . . .  8
6.  Reboot Time Option . . . . . . . . . . . . . . . . . . . . . .  9
  6.1.  Description  . . . . . . . . . . . . . . . . . . . . . . .  9
  6.2.  Packet Format  . . . . . . . . . . . . . . . . . . . . . .  9
  6.3.  Applicability  . . . . . . . . . . . . . . . . . . . . . . 10
  6.4.  Response to RFC 3942 . . . . . . . . . . . . . . . . . . . 10
  6.5.  Client and Server Behaviour  . . . . . . . . . . . . . . . 10
7.  Specification Conformance  . . . . . . . . . . . . . . . . . . 11
8.  Security Considerations  . . . . . . . . . . . . . . . . . . . 11
9.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 11
10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 12
11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  11.1. Normative References . . . . . . . . . . . . . . . . . . . 12
  11.2. Informative References . . . . . . . . . . . . . . . . . . 12

1. Introduction โœจ

Okay so, PXE (the Preboot eXecution Environment) is a first-stage network bootstrap agent ๐Ÿฆ‹. It's loaded out of the firmware on the client host, and it does DHCP [3] queries to get an IP address.

Once it's on the network, it loads a second-stage bootstrap agent, based on what the DHCP header and option contents tell it to do ๐Ÿ“.

PXELINUX is one of those second-stage bootstrap agents ๐Ÿ’…. Once PXE hands execution over to it, PXELINUX looks for its configuration in a cache of DHCP options that were supplied to the PXE first-stage agent, and then takes action based on those options.

Most often, this means loading one or more images over Trivial File Transfer Protocol (TFTP) [6]. Those images get decompressed into memory and then run, which passes execution to the final Host Operating System ๐Ÿ”ฅ.

PXELINUX uses DHCP options 208-211 to control parts of this bootstrap process ๐Ÿซถ. These options aren't requested by the PXE DHCP client when it acquires its lease, though. At that point the PXE bootloader has no clue PXELINUX is going to be in use, and even if it did, it wouldn't know which option(s) PXELINUX might digest ๐Ÿ™ˆ. Local installations that serve this PXELINUX image to their clients have to configure their DHCP servers to provide these options anyway, even though they aren't on the DHCP Parameter Request List [4] ๐Ÿ’€.

These options are:

  • "MAGIC" - 208 - An option whose presence and content lets the PXELINUX bootloader verify that options 209-211 are meant for the purpose described here ๐Ÿ”ฎ.
  • "ConfigFile" - 209 - Sets the path/filename part of the configuration file's location, which this bootloader should use to configure itself ๐ŸŽ€.
  • "PathPrefix" - 210 - Sets a value that gets prepended to the ConfigFile to work out the directory location of the file ๐Ÿ—บ๏ธ.
  • "RebootTime" - 211 - Sets a timeout after which the bootstrap program reboots the system (most likely sending it back to PXE) โฐ.

Historically, these option codes numbering from 208-211 were designated 'Site Local' ๐Ÿ•ฐ๏ธ. After RFC3942 [8] came out, though, they were made available for allocation as new standard DHCP options ๐ŸŒˆ.

This document marks these codes as assigned โœ….

Now, this direct assignment of option code values in the option definitions below is pretty unusual ๐Ÿค”. It isn't mentioned in the DHCP Option Code assignment guidelines [5]. This document's Option Code assignments are done within RFC 3942's provisions for documenting prior use of option codes within the new range (128-223 inclusive) ๐Ÿ’–.


2. Terminology ๐Ÿ“–

  • "first-stage bootloader" - A boot order can have lots of stages, like a BIOS booting a DOS Boot Disk that then loads a PXE executable. In that example, only the PXE executable is what this document calls the "first-stage bootloader". It's basically the first stage of booting where DHCP is involved ๐ŸŒธ.
  • "second-stage bootloader" - A program that the first-stage bootloader loads at the behest of the DHCP server ๐Ÿงš.
  • "bootloader" and "network bootstrap agent" - These are synonyms, except that "bootloader" is intentionally vague, since its next form of bootstrapping may not actually involve network resources ๐Ÿซถ.

Ok so the key words "MAY", "MUST", "MUST NOT", "SHOULD", and "SHOULD NOT" in this document are to be interpreted as described in RFC 2119 [2] ๐Ÿ’œ.


3. MAGIC Option ๐Ÿช„

3.1. Description

If this option is provided to the PXE bootloader, then PXELINUX checks that the value matches the octet string f1:00:74:7e ๐Ÿ”. If it matches, PXELINUX bootloaders will also consume options 209-211, as described below. Otherwise, they get ignored ๐Ÿ™….

This measure was intended to make sure that, since the 'Site Local' option space isn't allocated from a central authority, no conflict would make a PXELINUX bootloader improperly digest options meant for some other purpose ๐Ÿ›ก๏ธ.

3.2. Packet Format

The MAGIC Option format looks like this:

           Code    Length     m1       m2       m3       m4
        +--------+--------+--------+--------+--------+--------+
        |   208  |    4   |  0xF1  |  0x00  |  0x74  |  0x7E  |
        +--------+--------+--------+--------+--------+--------+

The code for this option is 208. The length is always four ๐Ÿ”ข.

3.3. Applicability

This option is totally, absolutely not for any other purpose ๐Ÿšซ.

3.4. Response to RFC 3942

The option code 208 will be adopted for this purpose and immediately deprecated. Future standards action may return this option to an available status should it be necessary ๐Ÿ”„.

A collision on this option is harmless (at least from PXELINUX' point of view) by design. If it doesn't match the aforementioned magic value, the PXELINUX bootloader takes no special action ๐Ÿ˜Œ.

The PXELINUX project will deprecate the use of this option. Future versions of the software won't evaluate its contents ๐Ÿ‘‹.

It's reasonable to use this option code for another purpose, but it's recommended to do that at a later time, given the desire to avoid potential collisions in legacy user bases ๐Ÿ•ฐ๏ธ.


4. Configuration File Option ๐Ÿ“‚

4.1. Description

Once the PXELINUX executable has been entered from the PXE bootloader, it evaluates this option and loads a file of that name via TFTP. The contents of that file configure PXELINUX for its next stage of bootloading. That covers things like boot image names, locations, boot-time flags, and text to show the user in menu selections, etc ๐Ÿฝ๏ธ.

Without this option, the PXELINUX agent searches the TFTP server (as determined by PXE prior to this stage) for a config file with several default names ๐Ÿ”Ž.

4.2. Packet Format

The Configuration File Option format looks like this:

           Code    Length    Config-file...
        +--------+--------+--------+--------+--------+--------+
        |   209  |    n   |   c1   |   c2   |   ...  |   c(n) |
        +--------+--------+--------+--------+--------+--------+

The code for this option is 209. The Config-file (c1..c(n)) is an NVT-ASCII [1] printable string. It isn't terminated by a zero or any other value ๐Ÿงต.

4.3. Applicability

Any bootloader, PXE or otherwise, that uses a separate configuration file, rather than putting all of its configuration in DHCP options (which can be impossible because DHCP options only have so much space), might conceivably make use of this option ๐Ÿคทโ€โ™€๏ธ.

4.4. Response to RFC 3942

The code 209 will be adopted for this purpose ๐Ÿ’….

4.5. Client and Server Behaviour

The Config File Option MUST be supplied by the DHCP server if it appears on the Parameter Request List, but it MUST also be supplied if the server administrator believed it would later be useful to the client. An example would be a server configured to offer a second-stage boot image that they know will make use of it ๐Ÿฅน. The option MUST NOT be supplied if no value has been configured for it, or if a value of zero length has been configured ๐Ÿšซ.

The DHCP client MUST only cache this option in a location the second-stage bootloader may access ๐Ÿ—๏ธ.

The second-stage bootloader MUST, in concert with other DHCP options and fields, use this option's value as a filename to be loaded via TFTP and read for further second-stage-loader-specific configuration parameters. The format and content of such a file are specific to the second-stage bootloader, so they're out of scope for this document ๐Ÿ™Œ.


5. Path Prefix Option ๐Ÿ›ค๏ธ

5.1. Description

So in PXELINUX' case, it's often that several different environments share the same TFTP path prefix but have different filenames. For example, hosts' bootloader images and config files might be kept in a directory structure derived from their Media Access Control (MAC) address ๐Ÿ’ป. That's why it was deemed worthwhile to deliver a TFTP path prefix configuration option. That way the two things can be configured separately in a DHCP Server configuration: the prefix, and the possibly host-specific file location ๐Ÿฆ‹.

The actual filename that PXELINUX requests from its TFTP server is derived by prepending this value to the Config File Option above. Once that config file is loaded and during processing, any TFTP file paths specified within it are processed the same way, by prepending the contents of this option ๐ŸŒŸ.

5.2. Packet Format ๐Ÿ’…

okay so here's what the Path Prefix Option looks like on the wire ๐Ÿ‘€

              Code    Length   Path-Prefix...
           +--------+--------+--------+--------+--------+--------+
           |   210  |    n   |   p1   |   p2   |   ...  |   p(n) |
           +--------+--------+--------+--------+--------+--------+

the code for this option is 210 ๐Ÿฆ‹. the Path Prefix is an NVT-ASCII printable string ๐ŸŽ€, and it is not terminated by zero or any other value (no null terminator, bestie ๐Ÿ™ˆ).

5.3. Applicability ๐Ÿงš

so this option exists because server admins found it super useful to set the prefix and the suffix of the config file path separately ๐Ÿ’–. a bunch of different PXE booting clients might share the same path prefix but use different filenames, or the other way round ๐ŸŒธ.

the 'shortcut' this represents is worth it, but ngl it's questionable whether it actually needs to show up on the protocol wire ๐Ÿค”.

it only gets interesting from a protocol standpoint if other options get adopted that prefix this value too, bc a kind of string compression is highly beneficial when the DHCP option space is so limited ๐Ÿซถ.

but it's clearly not applicable to any current use of, e.g., the FILENAME header contents or the DHCP Boot File Name option (#67) ๐Ÿšซ. these fields are baked into firmware on thousands of devices that can't or aren't likely to get upgraded ๐Ÿ˜ญ, so altering any behaviour here is likely to cause severe compatibility problems ๐Ÿ’€.

compression of the TFTP-loaded config file contents isn't a compelling factor, but contrived setups using these values might exist. picture lots of different clients loading the same config file with the same contents, but a differently configured path prefix makes them actually load different images ๐Ÿ‘‘. whether this sort of use is truly needed is still unproven โœจ.

5.4. Response to RFC 3942 ๐ŸŽ€

the code 210 will be adopted for this purpose ๐Ÿ’….

5.5. Client and Server Behaviour ๐Ÿ“œ

okay, the rules part, so listen up ๐Ÿ‘‚

the DHCP server MUST supply the Path Prefix option if it shows up on the Parameter Request List ๐Ÿ’Œ. the server MUST also supply it if the server administrator thinks it'll be useful to the client later on (like if the server offers a second-stage boot image that they know will use it) ๐Ÿง . the option MUST NOT be supplied if no value has been configured for it, or if a zero-length value has been configured ๐Ÿ™….

the DHCP client MUST only cache this option somewhere the second-stage bootloader can reach it ๐Ÿ—๏ธ.

the second-stage bootloader MUST prepend this option's value (if there is one) to the contents of the ConfigFile option before it fetches the resulting value via TFTP. it does the same to the default 'Config File Search Path', which the second-stage bootloader works through when there's no Config File Option ๐Ÿ›ฃ๏ธ. the client MAY also prepend the value to other configuration directives within that file once it's loaded ๐Ÿ“„. the client MUST NOT prepend this option's value to any other DHCP option contents or field, unless a document describing that option or field explicitly says so ๐Ÿšซ.

6. Reboot Time Option โฐ

6.1. Description ๐Ÿ”„

so picture this: PXELINUX runs, and then for some reason it can't reach its TFTP server to keep bootstrapping ๐Ÿ˜ฑ. by default, the client reboots itself after 300 seconds have passed. that might be too long, too short, or just totally inappropriate behaviour, depending on the environment ๐Ÿ™ƒ.

by configuring a non-zero value in this option, admins can tell PXELINUX exactly which timeout they want ๐ŸŽฏ. the client reboots itself if it fails to get its configured network resources within that many seconds โฑ๏ธ.

this reboot runs through the system's normal boot-time execution path, which most likely leads it back to PXE and therefore PXELINUX ๐Ÿ”. so in the general case, it's kinda like sending the client back to the DHCP INIT state ๐Ÿซ .

by configuring zero, the feature is disabled, and the client instead removes itself from the network and waits indefinitely for operator intervention ๐Ÿง.

it's worth stressing that this has nothing to do with configuring a lease time โ—. the perceived move back to INIT state comes from the client's running state (it's reinitializing itself), not from lease timer activity. so it's not safe to assume a PXELINUX client will abandon its lease when this timer expires ๐Ÿšจ.

6.2. Packet Format ๐Ÿ“ฆ

the Reboot Time Option format looks like this:

              Code    Length
           +--------+--------+--------+--------+--------+--------+
           |   211  |    4   |            Reboot Time            |
           +--------+--------+--------+--------+--------+--------+

the code for this option is 211 ๐Ÿฆ‹. the length is always four ๐Ÿ”ข. the Reboot Time is a 32-bit (4 byte) integer in network byte order ๐Ÿ’œ.

6.3. Applicability ๐ŸŒ

any network bootstrap program in any sufficiently complex networking environment could end up in a similar situation ๐Ÿ˜ฌ. maybe its IP address gets stolen out from under it by a rogue client on the network, maybe it gets moved between networks where its PXE-derived DHCP lease isn't valid anymore, or maybe it's some other similar thing.

it seems desirable for any network bootstrap agent to have an ultimate timeout so it can start over ๐Ÿ”.

the client might, for example, get different working configuration parameters from a different DHCP server when it restarts ๐Ÿคท.

6.4. Response to RFC 3942 ๐ŸŽ€

the code 211 will be adopted for this purpose ๐Ÿ’….

6.5. Client and Server Behaviour ๐Ÿ“œ

the DHCP server MUST supply the Reboot Time Option if it shows up on the Parameter Request List ๐Ÿ’Œ. the server MUST also supply it if the server administrator thinks it'll be useful to the client later (like if the server offers a second-stage boot image that they know will use it) ๐Ÿง . the option MUST NOT be supplied if no value has been configured for it, or if it contains a zero-length value ๐Ÿ™….

the DHCP client MUST only cache this option somewhere the second-stage bootloader can access it ๐Ÿ—ƒ๏ธ.

if the value of this option is nonzero, the second-stage bootloader MUST schedule a timeout โฒ๏ธ. once a number of seconds equal to this option's value has passed, the second-stage bootloader MUST reboot the system, ultimately returning the path of execution back to the first-stage bootloader ๐Ÿ”™. it MUST NOT reboot the system once the thread of execution has been passed to the host operating system (at that point the timeout is basically moot ๐Ÿซฅ).

if the value of this option is zero, the second-stage bootloader MUST NOT schedule such a timeout at all 0๏ธโƒฃ๐Ÿšซ. any second-stage bootloader that finds it has run into excessive timeouts trying to obtain its host operating system SHOULD disconnect itself from the network to wait for operator intervention ๐Ÿ™‹. it MAY continue trying to acquire the host operating system indefinitely โ™พ๏ธ.

7. Specification Conformance ๐Ÿ“‹

to conform to this specification, clients and servers MUST implement the Configuration File, Path Prefix, and Reboot Time options as directed ๐Ÿ’ฏ.

the MAGIC option MAY NOT be implemented, as it has been deprecated ๐Ÿชฆ.

8. Security Considerations ๐Ÿšจ

โš ๏ธ okay bestie, this section is seriously important, so read it carefully ๐Ÿซถ

PXE and PXELINUX let any entity acting as a DHCP server execute arbitrary code on a system ๐Ÿ˜ฑ. right now, no PXE implementation is known to implement authentication mechanisms [7], so PXE clients can't be sure they're getting configuration information from the correct, authoritative DHCP server ๐Ÿ’€.

the use of TFTP by PXE and PXELINUX also lacks any form of cryptographic signature, so a 'Man in the Middle' attack may lead to an attacker's code being executed on the client system ๐Ÿ•ต๏ธ. since this isn't an encrypted channel, any of the TFTP-loaded data may also be exposed (like when loading a "RAMDISK" image, which contains /etc/passwd or similar information) ๐Ÿซฃ.

using the Ethernet MAC Address as the client's unique identity may allow an attacker who takes on that identity to gain inappropriate access to a client system's network resources. the DHCP server can hand over whatever 'keys' are required to actually be the target system, so the attacker can boot as though they were the target ๐ŸŽญ.

great care should be taken to secure PXE and PXELINUX installations, such as by using IP firewalls, to reduce or eliminate these concerns ๐Ÿ”’.

a nearby attacker might feed a "Reboot Time" option value of 1 second to a mass of unsuspecting clients, to effect a Denial Of Service (DoS) upon the DHCP server ๐Ÿ“‰. but then again, it may just as easily supply these clients with rogue second-stage bootloaders that simply transmit a flood of packets ๐ŸŒŠ.

this document in and by itself provides no security, nor does it impact existing DCHP security as described in RFC 2131 [3] ๐Ÿ”.

9. IANA Considerations ๐Ÿ—‚๏ธ

IANA has done the following:

  1. Moved DHCPv4 Option code 208 from 'Tentatively Assigned' to 'Assigned', referencing this document. IANA has marked this same option code, 208, as Deprecated.
  2. Moved DHCPv4 Option code 209 from 'Tentatively Assigned' to 'Assigned', referencing this document.
  3. Moved DHCPv4 Option code 210 from 'Tentatively Assigned' to 'Assigned', referencing this document.
  4. Moved DHCPv4 Option code 211 from 'Tentatively Assigned' to 'Assigned', referencing this document.

10. Acknowledgements ๐Ÿ’œ

these options were designed and implemented for the PXELINUX project by H. Peter Anvin, and he was instrumental in producing this document ๐Ÿ‘‘. Shane Kerr has also provided feedback that has improved this document ๐Ÿซถ.

11. References ๐Ÿ“š

11.1. Normative References ๐Ÿฆ‹

  • [1] Postel, J. and J. Reynolds, "Telnet Protocol Specification", STD 8, RFC 854, May 1983.
  • [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [3] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997.
  • [4] Alexander, S. and R. Droms, "DHCP Options and BOOTP Vendor Extensions", RFC 2132, March 1997.
  • [5] Droms, R., "Procedures and IANA Guidelines for Definition of New DHCP Options and Message Types", BCP 43, RFC 2939, September 2000.

11.2. Informative References ๐ŸŒธ

  • [6] Sollins, K., "The TFTP Protocol (Revision 2)", STD 33, RFC 1350, July 1992.
  • [7] Droms, R. and W. Arbaugh, "Authentication for DHCP Messages", RFC 3118, June 2001.
  • [8] Volz, B., "Reclassifying Dynamic Host Configuration Protocol version 4 (DHCPv4) Options", RFC 3942, November 2004.

Author's Address ๐Ÿ–Š๏ธ

David W. Hankins
Internet Systems Consortium, Inc.
950 Charter Street
Redwood City, CA  94063
US

Phone: +1 650 423 1307
EMail: David_Hankins@isc.org

Copyright (C) The IETF Trust (2007).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐ŸŒˆ

Intellectual Property โœจ

okay so the IETF is being super clear here ๐Ÿ’… it takes no position on whether any Intellectual Property Rights or other rights that might be claimed to pertain to using or implementing the tech in this document are valid or in scope. it also doesn't say whether any license under those rights might or might not be available ๐Ÿซ  and it hasn't made any independent effort to go hunting for those rights, so don't assume it did ๐Ÿ™ˆ if you want the rules on rights in RFC documents, check out BCP 78 and BCP 79 ๐Ÿ“š

copies of IPR disclosures sent to the IETF Secretariat are a thing, and so are any assurances of licenses that get made available. the same goes for the results of an attempt to get a general license or permission for implementers or users to use those proprietary rights ๐ŸŽ€ you can find all of that in the IETF's online IPR repository at http://www.ietf.org/ipr ๐Ÿฆ‹

and the IETF invites any interested party to flag its attention to any copyrights, patents or patent applications, or other proprietary rights that might cover tech needed to implement this standard ๐Ÿซถ send that info to the IETF at ietf-ipr@ietf.org ๐Ÿ’Œ bestie, it's giving transparency ๐ŸŒˆ

๐Ÿ“ฆ where this page comes from