Setting DHCP Option 43
Option 43 (Class identifier) allows you to inform the target that the location of the PXE server is known.
Option 43 is a binary buffer, containing a list of sub-options. Sub-options are packed in the binary buffer in no specific order. Most sub-options are optional.
An exhaustive list of sub-options can be found in the PXE specifications. Only sub-options of interest to specify the IP address of the PXE server are described here. Other configurations, like multicast discovery, multiple unicast servers, or multiple choices, are not explained in this section.
- PXE option 6: PXE_DISCOVERY_CONTROL
- This option specifies how the PXE client contacts PXE servers, using either unicast, multicast or broadcast. The format of this option is one byte.
- PXE option 8: PXE_BOOT_SERVERS
- A list of IP addresses, each address corresponding to one PXE server (when discovery_control is unicast). A PXE server is identified by a number (the standard value for BigFix Bare Metal Server is 15) and its IP address. The format of this option is two bytes for the server type, one byte for the number of servers to list (1 in our example), and four bytes per server address.
- PXE option 9: PXE_BOOT_MENU
- This option contains a list of choices to prompt on the screen at boot time. You need to have a PXE boot menu even if it is not used. The format of this option is two bytes for the server type, one byte for the length of the string to display, and the string to display on screen. The total length of this option is 5 bytes.
- PXE option 10 (0A): PXE_BOOT_TIMEOUT
- This option is required to specify how long (in seconds) the boot menu is displayed, and the text of a prompt that is displayed during waiting time. The format of this option is one byte for the timeout value, followed by the prompt text.
- PXE option 255 (FF): PXE_END
- To be valid, the binary buffer of DHCP option 43 must end with FF.
Setting DHCP Option 43
If your DHCP server is running on Windows, you can enter the suboption values one at a time in option 43, by selecting hexadecimal input.
If your DHCP server is ISC DHCP (version 2.x), then you can enter the suboption values as provided in the examples (bytes separated with colons) for parameter vendor-encapsulated-options (the exact name depends on the version you are using).
# In the global section:
option space PXE;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.boot-server code 8 = { unsigned integer 16,
unsigned integer 8,
ip-address };
option PXE.boot-menu code 9 = { unsigned integer 16,
unsigned integer 8,
text};
option PXE.menu-prompt code 10 = { unsigned integer 8, text };
# In the scope/host section:
option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,60,43);
option vendor-class-identifier "PXEClient";
vendor-option-space PXE;
option PXE.discovery-control 7;
option PXE.boot-server 15 1 <ip address of the PXE server>;
option PXE.boot-menu 15 5 "Rembo";
option PXE.menu-prompt 0 "Rembo";
Example: Option 43 for PXE servers on different subnets
- PXE option 6, length 1, value=07
- Value 7 means use PXE_BOOT_SERVERS list, disable multicast and broadcast discovery
- PXE option 8, length 7, value = 00:0F:01:C0:0A:0A:0A
- (targets A and B) Only one IP address is used, the address of the PXE server for the target which receives these DHCP options.
- PXE option 8, length 7, value = 00:0F:01:C0:0A:0B:0A
- (targets C and D) Only one IP address is used, the address of the PXE server for the target which receives these DHCP options.
- PXE option 9, length 5, value = 00:0F:02:52:42
- There is only one line, displaying RB, and which goes to server type 15 (BigFix Bare Metal Server).
- PXE option A, length 2, value=00:52
- The timeout is set to 0 seconds, meaning that one wants to boot using the first line of the boot menu ,and the prompt is set to R. Because the timeout is 0, the prompt text is not displayed, but it must be at least one character long.
- PXE option FF
- This closes the buffer
The format of the binary buffer is similar to what is used for the DHCP packet itself. The buffer is a list of options, each option starting with its option number (one byte), followed by its length (one byte), and its value (a list of bytes).
Here is the transcription of the above example, for targets A and B:Option 43 =
06:01:07:08:07:00:0F:01:C0:0A:0A:0A:09:05:00:0F:02:52:42:0A:02:00:52:FF
Option 43 =
06:01:07:08:07:00:0F:01:C0:0A:0B:0A:09:05:00:0F:02:52:42:0A:02:00:52:FF
Example: Option 43 to create a PXE boot menu
The administrator wants to display two lines in the PXE boot menu, pointing to two separate OS deployment servers. The two servers must use different PXE server type numbers or they will be seen as only one server by the PXE network card.
In addition to the standard PXE server type 15, OS deployment server accepts any number between 33008 (80F0 in hexadecimal) and 33280 (8200 in hexadecimal). These new PXE server type numbers are used to differentiate multiple OS deployment servers in the BOOT_SERVERS sub-option of DHCP option 43.
In this example, the first server has the address 192.168.1.4 (C0:A8:01:04 in hexadecimal), and the second server, 192.168.1.5 (C0:A8:01:05 in hexadecimal).
- Assign an OS deployment server type to each of the servers. OS deployment servers accept server type 15, and server types from 33008 to 33280. For this example, 33008 (80F0) is used for the first server, and 33009 (80F1) for the second server.
- The sub-options of DHCP option 43 must then be configured as follows:
- PXE option 6, length 1,value = 07
- Value 7 means use PXE_BOOT_SERVERS list, disable multicast and broadcast discovery
- PXE option 8, length 14 (0E), value = 80:F0:01:C0:A8:01:04:80:F1:01:C0:A8:01:05
- Option 8 defines the two PXE servers. The first server is defined by the first 7 bytes, starting with the OS deployment server type (80:F0, 33008), followed by one IP address: C0:A8:01:05 (192.168.1.4). The second server is defined in the following manner, using OS deployment server type 80:F1 (33009).
- PXE option 9, length 22 (16), value = 80:F0:08:53:65:72:76:65:82:20:41:80:F1:08:53:65:72:76:65:82:20:42
- Option 9 defines the boot menu that is displayed at boot time. The first 11 bytes correspond to the first line, for the first server. It shows the string Server A, associated with type 80:F0 (first server). The second line shows the string Server B, associated with type 80:F1 (second server).
- PXE option A, length 6, value =0F:53:65:6C:65:63:74
- Option 10 (0A) specifies a 15 second timeout and shows the string Select as the boot menu prompt.
- PXE option FF
- To close the buffer.
06:01:07:08:0E:80:F0:01:C0:A8:01:04:80:F1:01:C0:A8:01:05:
09:16:80:F0:08:53:65:72:76:65:82:20:41:80:F1:08:53:65:72:76:65:82:20:42:
0A:06:0F:53:65:6C:65:63:74:FF
When your boot menu is displayed on your
target screen, press F8 to make your selection.