Skip to content

Add instructions for enabling network booting for a Pi 3B+ and 4. #1930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions hardware/raspberrypi/bootmodes/net_tutorial.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Network boot your Raspberry Pi

This tutorial is written to explain how to set up a simple DHCP/TFTP server which will allow you to boot a Raspberry Pi 3 from the network. The tutorial assumes that you have an existing home network, and that you want to use a Raspberry Pi for the **server**. You will need a second Raspberry Pi 3 as a **client** to be booted. Only one SD card is needed because the client will be booted from the server after the initial client configuration.
This tutorial is written to explain how to set up a simple DHCP/TFTP server which will allow you to boot a Raspberry Pi 3 or 4 from the network. The tutorial assumes that you have an existing home network, and that you want to use a Raspberry Pi for the **server**. You will need a second Raspberry Pi 3 as a **client** to be booted. Only one SD card is needed because the client will be booted from the server after the initial client configuration.

Due to the huge range of networking devices available, we can't guarantee that network booting will work with any device. We have had reports that, if you cannot get network booting to work, disabling STP frames on your network may help.

## Client configuration
## Client configuration (Raspberry Pi 3B)

This section only applies to the **original** Raspberry Pi 3B; if you are using the 3B+ or Pi 4 then ignore this section and skip to the server section below then.
This section only applies to the **original** Raspberry Pi 3B; if you are using the 3B+ or Pi 4 then follow the 3B+ section below.

Before a Raspberry Pi will network boot, it needs to be booted from an SD card with a config option to enable USB boot mode. This will set a bit in the OTP (One Time Programmable) memory in the Raspberry Pi SoC that enables network booting. Once this is done, the SD card is no longer required.

Expand Down Expand Up @@ -35,6 +35,18 @@ Ensure the output `0x3020000a` is correct.

The client configuration is almost done. The final thing to do is to remove the `program_usb_boot_mode` line from `config.txt` (make sure there is no blank line at the end). You can do this with `sudo nano /boot/config.txt`, for example. Finally, shut the client Raspberry Pi down with `sudo poweroff`.

## Client configuration (Raspberry Pi 3B+ / 4)

These instructions only apply to the Raspberry Pi 3B+ and 4.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Raspberry Pi 3B+ doesn't have a bootloader eeprom...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you're quite right, how silly of me! I will see if I can find out what is required on the 3B+ and update this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the 3B+ supports network (and USB) booting out-of-the-box?

Copy link

@ghost ghost Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the 3B+ supports network (and USB) booting out-of-the-box?

Correct. There's no configuration needed - if it hasn't found an SD card in 5 seconds it moves to USB host boot and tries USB MSD and net. See https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md and https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net.md.

I suspect the new docs manager, Alasdair Allan, will flatten the boot documentation into a single document post-#1911, so it's good to get the correct procedure documented now before that happens 👍


Follow the instructions on the [Pi 4 Bootloader Configuration](../bcm2711_bootloader_config.md) page to alter the boot order to include network booting. In short:

```bash
sudo -E rpi-eeprom-config --edit
```

Set `BOOT_ORDER` to `0xf21` or similar, save, and reboot. The updated EEPROM settings will be saved onto the SD card and programmed to the EEPROM during the next boot. After this reboot the settings will become permanent and the SD card is no longer required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be a raspi-config option to do this now, which is easier than using rpi-eeprom-config directly?

Ah yes: https://www.raspberrypi.org/documentation/configuration/raspi-config.md


## Ethernet MAC address
Before configuring network boot make a note of the serial number and mac address so that the board can be identified by the TFTP/DHCP server.

Expand Down