netbootxyz / netboot.xyz-docs

netboot.xyz documentation repository
https://netboot.xyz
21 stars 64 forks source link

Suggestion: Add ProxyDHCP support #113

Open lars18th opened 4 months ago

lars18th commented 4 months ago

Hi,

The use case is very easy (and common): you can't replace the current DHCP server on your network and you can't edit the configuration to add the next-server option to it.

In this case the only option is to use the ProxyDHCP way. How it works? It uses a non-standard booting method where your booting client receives two DHCP OFFER packets. One is from the stock DHCP server with the IP address and all other information. And another one from your booting server with the PXE data. You can read more from here https://github.com/pypxe/PyPXE/blob/master/DOCUMENTATION.md#proxydhcp

So because this project https://github.com/pypxe/PyPXE includes support for this extension, the idea is to include it. I've done some tests with it sudo python -m pypxe.server --dhcp-proxy --tftp and it works with success.

The suggestion is then to add this package to this container and use it to enable this mode. I hope you want to explore it. Regards.

antonym commented 4 months ago

ProxyDHCP is already supported, if you drop a local-vars.ipxe in your local tftp root and set:

set use_proxydhcp_settings true

That will enable the proxydhcp code path:

https://github.com/netbootxyz/netboot.xyz/blob/development/roles/netbootxyz/templates/disks/netboot.xyz.j2#L31

lars18th commented 4 months ago

Wow, that's great! I'll try it.

However, perhaps it has sense to add this description in the main README.md because this information has no visibility. And also I suggest to include a toggle in the UI to enable it, instead of a manual setting. Do you agree with that?

antonym commented 4 months ago

Moving to docs project to make a note to write some.