iPXE discussion forum
Uefi ipxe.efi Dnsmasq - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: Uefi ipxe.efi Dnsmasq (/showthread.php?tid=8198)



Uefi ipxe.efi Dnsmasq - GermanICTEmployee - 2016-10-04 12:48

Dear Mesdamias and Dear Sirs,

I would be pleased to get help. I use ipxe.efi at a Ubuntu 16.04 Desktop amd64 and dnsmasq serves as DHCP-Server.
The ipxe.efi works like a charm. I press "Control+B" and dhcp as well as "chain http://192.168.1.2/boot.ipxe" is loaded.


Now I am trying to automate download the http://192.168.1.2/boot.ipxe.

How can I arrange that with DnsMasq?

Many thanks for every help! Rolleyes
Beste wishes
GermanICTEmployee


RE: Uefi ipxe.efi Dnsmasq - NiKiZe - 2016-10-04 19:10

You want to do the chainloading
To do this with dnsmasq you can find one example here (not a dnsmasq user myself so can't verify)

An alternative would be to use script embeding but if possible using chanloading is the recommended way, not least since it easier to maintain and upgrade ipxe with the configuration all done in one place.

Edit in 2021: config for dnsmasq as proxydhcp server is available at appnote dnsmasq as proxydhcp and
My gist of dnsmasq proxydhcp for gentoo


RE: Uefi ipxe.efi Dnsmasq - GermanICTEmployee - 2016-10-05 19:51

Many thanks for your try. I tested that two weeks ago, forget this code it is too old.

Heureka, I broke the looop. :-) Yeeeeehaaa
Please add this to uefi and break the loop part on the documentation page.

First never use UEFI and DNSmasq in proxy mode combined. The DNSmasq does not answer! I double checked that with the dhcp-logs.
I waited for the PXEClient String to transfer ipxe.efi from tftproot. After that I let DNSmasq match iPXE strings with option 175.
Besides you see I also integrated pxelinux for "bios / legacy" and several other uefi architectures.

You have to place on root at tftp the "bootstrap.ipxe / boot.ipxe".
Only one line is needed in the script for ipxe.efi in boot.ipxe:
tftproot/boot.ipxe
Code:
chain http://192.168.1.2/boot.ipxe

The /etc/dnsmasq.conf
Code:
##Global settings
#Interface
interface=enp1s0

#port=0

#Log everything in syslog
log-dhcp
listen-address=192.168.1.2
no-hosts

#PXE boot
#pxe-prompt="Press F8 for boot menu", 10
#pxe-service=X86PC, “Boot from network”, pxelinux
#pxe-service=X86PC, "Boot from local hard disk", 0

#Domain settings
domain=boot.lan

#DHCP settings
dhcp-range=192.168.1.3,192.168.1.254,72h
#dhcp-host=MAC:IP
dhcp-option=3,192.168.1.2
dhcp-option=42,192.168.1.2
#dhcp-option=vendor:MSFT,2,li
#dhcp-boot=pxelinux.0
#dhcp-boot=net:Name,Bootfile
dhcp-authoritative

dhcp-match=set:bios,60,PXEClient:Arch:00000
dhcp-boot=tag:bios,pxelinux.0,192.168.1.2

dhcp-match=set:efi32,60,PXEClient:Arch:00006
dhcp-boot=tag:efi32,syslinux32.efi,192.168.1.2

#load ipxe.efi from tftp server
dhcp-match=set:efibc,60,PXEClient:Arch:00007
dhcp-boot=tag:efibc,ipxe.efi,192.168.1.2

#wait for match that contains iPXE sends request to dnsmasq and option 175 a 2nd boot-file
dhcp-match=set:iPXE,175
dhcp-boot=tag:iPXE,boot.ipxe #file is on tftp-root

dhcp-match=set:efi64,60,PXEClient:Arch:00009
dhcp-boot=tag:efi64,efi64/syslinux.efi,192.168.1.2

#TFTP settings
enable-tftp
tftp-root=/var/lib/tftpboot



RE: uefi dnsmasq ipxe efi - robinsmidsrod - 2016-10-07 08:22

You need to set up http://ipxe.org/howto/chainloading to load ipxe and your ipxe boot script. The howto I linked to doesn't mention dnsmasq, but if you search the forum here you should be able to find several posts with a working setup for dnsmasq chainloading.


RE: uefi dnsmasq ipxe efi - GermanICTEmployee - 2016-10-10 21:47

Hello,
thank you, however, what I found in forum did not work! It seems for me to be out of date.

I was able to solve issue. Would you please add this as DNSmasq Code to run ipxe.efi at UEFI section or to the FAQ.

I apologize for "duplicate record" here. I point to here: http://forum.ipxe.org/showthread.php?tid=8198

Beste wishes
GermanICTEmployee