OpenWrt Forum Archive

Topic: [HOW-TO] Preparing for PXE boot using dnsmasq

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

dnsmasq has all that is needed to support a basic PXE boot.
- dnsmasq is already installed and doing it's work: so no need to install, just configure

- enable tftp in dnsmasq
- specify tftp-root
- specify boot file

The /etc/config/dnsmasq does not seem to support the above, so one has to edit /etc/init.d/dnsmasq for this.

To test, remember that dnsmasq only supports binary if you want to get the file with a tftp client program.

Then follow your favorite HOW-TO for PXE using openwrt as dhcp/tftp/boot server

/etc/init.d/dnsmasq
- with, for example, tftproot /mnt/usbdrive

start() {
    include /lib/network
    scan_interfaces
    config_load /var/state/network
    config_load dhcp
#      args=""
    args=" --enable-tftp --tftp-root=/mnt/usbdrive --dhcp-boot=/mnt/usbdrive/pxelinux.0"

(Last edited by oxo on 12 Oct 2008, 23:32)

Hi,

support for those options is now added in https://dev.openwrt.org/changeset/12960 .

Now you can do:

uci set dhcp.@dnsmasq[0].enable_tftp=1
uci set dhcp.@dnsmasq[0].tftp_root=/mnt/usbdrive
uci set dhcp.@dnsmasq[0].dhcp_boot=/mnt/usbdrive/pxelinux.0
uci commit dhcp
/etc/init.d/dnsmasq restart

~ JoW


Edit: corrected uci commands

(Last edited by jow on 22 Oct 2008, 19:23)

Thanks smile

Lovely.
- I was just looking at the code as to how to configure in configuration: but you beat me to it smile

(Last edited by oxo on 13 Oct 2008, 15:21)

I haven' figured out how to get LuCi to take these values with add custom in dnsmasq screen
- for example tftpboot can be entered but then it is lost ...

It's not implemented yet, it will be included in one of the upcoming rc releases after rc1

~ JoW

I forgot to say that I am running an image from the trunk

The discussion might have continued from here.