5

I've been running into issues trying to get a RPi 3B PXE booting - the Pi doesn't appear to make any TFTP request once it receives a DHCP response, but instead remakes the BOOTP request. This might indicate that it thinks the response is invalid in some way?

I have a DHCP server on 192.168.2.1 (Kea DHCP), and a TFTP server on a different host (192.168.2.2). I can manually pull files from the TFTP server, and see that in the TFTP log. I'm aware that I've got to set option 60 to PXEClient, option 67 to the TFTP address and option 43 should contain Raspberry Pi Boot. Using dhcpdump -i eth0.2 -h b8:27:eb:bf:db:dd, this is the DHCP response being sent. Any obvious issues that would cause the Pi to reject it?

  TIME: 2018-04-03 18:10:15.501    
    IP: 0.0.0.0 (b8:27:eb:bf:db:dd) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)                                                                                                                                                                      
    OP: 1 (BOOTPREQUEST)          
 HTYPE: 1 (Ethernet)                  
  HLEN: 6                   
  HOPS: 0            
   XID: 26f30339                    
  SECS: 0             
 FLAGS: 0                  
CIADDR: 0.0.0.0           
YIADDR: 0.0.0.0           
SIADDR: 0.0.0.0                          
GIADDR: 0.0.0.0
CHADDR: b8:27:eb:bf:db:dd:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 12) Parameter Request List     43 (Vendor specific info)
                                             60 (Vendor class identifier)
                                             67 (Bootfile name)
                                            128 (???)
                                            129 (???)
                                            130 (???)
                                            131 (???)
                                            132 (???)
                                            133 (???)
                                            134 (???)
                                            135 (???)
                                             66 (TFTP server name)

OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  97 ( 17) UUID/GUID                 0044444444444444 .DDDDDDD
                                            4444444444444444 DDDDDDDD
                                            44               D
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2018-04-03 18:10:15.502
    IP: 192.168.2.1 (0:4:23:64:7d:c2) > 192.168.2.19 (b8:27:eb:bf:db:dd)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 26f30339
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.2.19
SIADDR: 192.168.2.2
GIADDR: 0.0.0.0
CHADDR: b8:27:eb:bf:db:dd:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:   1 (  4) Subnet mask               255.255.255.0
OPTION:   3 (  4) Routers                   192.168.2.1
OPTION:   6 (  4) DNS server                192.168.2.1
OPTION:  43 ( 20) Vendor specific info      0112526173706265 ..Raspbe
                                            7272792050692042 rry Pi B
                                            6f6f74ff         oot.
OPTION:  51 (  4) IP address leasetime      4000 (1h6m40s)
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         192.168.2.1
OPTION:  60 (  9) Vendor class identifier   PXEClient
OPTION:  66 ( 11) TFTP server name          192.168.2.2
OPTION:  67 ( 12) Bootfile name             bootcode.bin
  • Just added - including the BOOTP request that's logged – growse Apr 4 '18 at 21:31
3

I don't see any obvious issue but I do see some differences with my setup that you might want to explore. For example, my option 43 text is different and that might cause failure. For comparison I've included my output of the same command (with different mac address of course):

  TIME: 2018-04-09 15:49:59.172
    IP: 0.0.0.0 (b8:27:eb:12:45:bf) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 26f30339
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: b8:27:eb:12:45:bf:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  55 ( 14) Parameter Request List     43 (Vendor specific info)
                                             60 (Vendor class identifier)
                                             67 (Bootfile name)
                                            128 (???)
                                            129 (???)
                                            130 (???)
                                            131 (???)
                                            132 (???)
                                            133 (???)
                                            134 (???)
                                            135 (???)
                                             66 (TFTP server name)
                                              1 (Subnet mask)
                                              3 (Routers)

OPTION:  93 (  2) Client System             0000             ..
OPTION:  94 (  3) Client NDI                010201           ...
OPTION:  97 ( 17) UUID/GUID                 00bf4512a2bf4512 ..E...E.
                                            a2bf4512a2bf4512 ..E...E.
                                            a2               .
OPTION:  60 ( 32) Vendor class identifier   PXEClient:Arch:00000:UNDI:002001
---------------------------------------------------------------------------

  TIME: 2018-04-09 15:49:59.173
    IP: 192.168.1.10 (0:25:11:a6:ce:f8) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 26f30339
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: b8:27:eb:12:45:bf:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         192.168.1.10
OPTION:  60 (  9) Vendor class identifier   PXEClient
OPTION:  97 ( 17) UUID/GUID                 00bf4512a2bf4512 ..E...E.
                                            a2bf4512a2bf4512 ..E...E.
                                            a2               .
OPTION:  43 ( 35) Vendor specific info      0601030a04005058 ......PX
                                            4509170000145261 E.....Ra
                                            7370626572727920 spberry
                                            506920426f6f7420 Pi Boot
                                            2020ff             .
---------------------------------------------------------------------------

I'm using several Pi models all successfully booting over the network:

Pi 3 model B+ - it cold boots correctly every time. I do have an issue rebooting it that other models don't but that's another story. Pi 3 model B - seems to work perfectly. Pi 2 - seems to work perfectly albeit needing an SD card with bootcode.bin file.

Another difference is that I'm using dnsmasq as the PXE boot and TFTP server. Let me know if you have other questions about my setup.

  • Thanks for providing me a trace that works - I think it may be option 43 that's the issue. I'll attempt to a) try and get Kea to output a 43 value as close to what you have (I notice you have the 3 extra spaces), and if that fails, try it with dnsmasq. – growse Apr 9 '18 at 15:09
2

According to https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net.md the option 43 field must be in the response and must include the string "Raspberry Pi Boot".

The important part of the reply is the Vendor-Option Option 43. This needs to contain the string "Raspberry Pi Boot", although, due to a bug in the boot ROM, you may need to add three spaces to the end of the string.

It looks like Kea should support the vendor option: http://kea.isc.org/docs/kea-guide.html#dhcp4-vendor-opts

  • I'm currently setting option 43 and the DHCP response contains "Raspberry Pi Boot", as per the dhcpdump output. – growse Apr 14 '18 at 18:09
0

I figured it out. The rPI is expecting a option 43 to be in a specific format. IBM had some documentation on the different fields and their meanings for PXE (https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.networkcomm/tcpip_dhcpv6_pxevendor.htm) but it essentially looks like that the rPI expects option 43 to have subfields defined. Specifically, I found it needs options 6 (PXE_DISCOVERY_CONTROL), 9 (PXE_BOOT_MENU) and 10 (PXE_BOOT_TIMEOUT) to be set.

In my config:

"option-def": [
{
    "name": "PXEDiscoveryControl",
    "code": 6,
    "space": "vendor-encapsulated-options-space",
    "type": "uint8",
    "array": false
},
{
    "name": "PXEMenuPrompt",
    "code": 10,
    "space": "vendor-encapsulated-options-space",
    "type": "record",
    "array": false,
    "record-types": "uint8,string"
},
{
    "name": "PXEBootMenu",
    "code": 9,
    "space": "vendor-encapsulated-options-space",
    "type": "record",
    "array": false,
    "record-types": "uint16,uint8,string"
}
],

Note that PXEBootMenu is formed of both an order, string length and then string. These can be set in the options:

  "option-data": [
    {"name": "boot-file-name", "data": "bootcode.bin"},
    {"name":"vendor-class-identifier", "data": "PXEClient" },
    {"name": "vendor-encapsulated-options"},
    {"name": "PXEBootMenu", "csv-format":true, "data": "0,17,Raspberry Pi Boot","space":"vendor-encapsulated-options-space"},
    {"name": "PXEDiscoveryControl", "data": "3","space":"vendor-encapsulated-options-space"},
    {"name": "PXEMenuPrompt", "csv-format":true, "data": "0,PXE","space":"vendor-encapsulated-options-space"}
  ]

This then works!

From dhcpdump:

OPTION:  43 ( 31) Vendor specific info      0601030914000011 ........
                                            5261737062657272 Raspberr
                                            7920506920426f6f y Pi Boo
                                            740a0400505845   t...PXE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.