Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use feature indicator to break infinite loop e.g. when booting Virtualbox VM
2020-04-22, 16:14
Post: #1
Lightbulb Use feature indicator to break infinite loop e.g. when booting Virtualbox VM
Hi,

I found a solution to a very specific problem I think which is worth sharing. This thread is about how to break the infinite loop in situations where your server / client is equipped with an iPXE ROM which misses crucial features and your DHCP / TFTP server is Dnsmasq.

So this is the exact context:
  • DHCP and TFTP is provided by Dnsmasq (version: 2.79 running on CentOS 8.1.1911)
  • PXE Clients are VMs in Virtualbox (version: 6.1.4 running on Arch Linux) with virtual network cards already equipped with iPXE
  • Bootable images are bz compressed, so iPXE feature bzImage required

As this didn't work out of the box I did some research without finding a concise solution. I refused to accept any of the following approaches:
  • Patch iPXE in ROM of virtual network cards coming with Virtualbox because this is not just about my personal Virtualbox but about a complete distributed development environment.
  • Uncompress the images to get rid of the bzImages because I just want to use the images as delivered by the various Linux live distributions and Linux installer ISO images.

So I had to break the infinite loop depending on the feature indicator refering to bzImage. This page made me confident that a solution is feasible: [url=https://ipxe.org/appnote/premature]. Actually it is described for ISC dhcpd but what about Dnsmasq. It says:
Quote:NOTE does have dnsmasq “encapsulate”?

And here is how I solved that in Dnsmasq. The trick is the 24 which refers to the feature indicator bzImage. I had tried a lot of different configs before I came finally to this very simple config.

Code:
#
# Set tag ipxe if DHCP option 175 is set and bzimage is supported by iPXE client
# https://ipxe.org/appnote/premature
#
dhcp-match=set:ipxe,175,24

#
# Transfer iPXE image to all non iPXE clients
#
dhcp-boot=tag:!ipxe,undionly.kpxe

#
# Transfer iPXE menu to all iPXE clients
#
dhcp-boot=tag:ipxe,http://ipxe.local/ipxe/menu.ipxe

Feel free to contact me for any questions regarding this. Any other thoughts on that?

Happy coding!

Tobias
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)