raspberrypi / piserver

Raspberry Pi Server wizard to serve Raspbian to network booting Pis
318 stars 60 forks source link

piserver tftpboot across subnets #26

Closed rprr closed 6 years ago

rprr commented 6 years ago

Is it possible for the piserver to work across different subnets? For example, the piserver computer would be at 192.168.1.10 while the clients would be 192.168.2.11-20 and 192.168.3.11-20.

maxnet commented 6 years ago
ip helper-address 1.2.3.4
ip helper-address 4.5.6.7

In which 1.2.3.4 and 4.5.6.7 are your DHCP server and Piserver.

rprr commented 6 years ago

Thank you for your reply. By 3+ do you mean, any pi with model 3 or above or is this restricted to the recently released 3b+.

I will read up on how the ip helper-address command works.

maxnet commented 6 years ago

3B+ For older Pi you need the SD card with bootcode.bin, if the tftp server is only reachable through using gateway.

Depending on what you are trying to achieve exactly, also other alternatives may be available. E.g. if your goal is to have Pi at multiple locations perform network booting over the Internet, building a VPN bridge between locations may also work, if your network gear supports that.

rprr commented 6 years ago

Thanks for the alternative suggestion. I will explore this and other options as well.

MeCJay12 commented 5 years ago

I don't mean to open a closed thread but I have an extension of this question. To boot a client from a PiServer on a different subnet, you need DHCP relay setup on the client's network. What if the DHCP server is on the client's network and a DHCP relay can't be setup in parallel? What DHCP options and settings need to be added?

An example: I have a Pi on my local network 192.168.3.X and it is trying to boot from 192.168.1.138. The 3.X subnet's DHCP server is the default gateway (pfSense). PfSense cannot run a DHCP relay and a DHCP server. What settings would I add to my DHCP server to get it to boot across subnets or do I need to setup a separate system to do DHCP relay in parallel?

maxnet commented 5 years ago

If Piserver is in another subnet it will only work if it are Pi 3+. Not for Pi 3 without the +

DHCP response must include the magic string "Raspberry Pi Boot", netmask and gateway IP must be provided and next-server IP must point to the Piserver tftp server.

MeCJay12 commented 5 years ago

Am I missing something with this config? Capture

maxnet commented 5 years ago

No need to mention bootcode.bin (But shouldn't hurt to have more options than necessary either)