Failure when Configuring PXE

I'm trying to get pxe boot working by adding in the 'Special PXE boot options for Dnsmasq' section of 'Network/DHCP and DNS'. It does not appear to be added to the config file being used by dnsmasq.
/etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        option start '200'
        option limit '250'
        option force '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

config boot
        option filename 'pxelinux.0'
        option serveraddress '192.168.1.5'
        option force '1'

/var/etc/dnsmasq.conf.cfg01411c

# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
localise-queries
read-ethers
enable-ubus=dnsmasq
expand-hosts
bind-dynamic
local-service
edns-packet-max=1232
domain=lan
local=/lan/
addn-hosts=/tmp/hosts
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.d/resolv.conf.auto
stop-dns-rebind
rebind-localhost-ok
dhcp-broadcast=tag:needs-broadcast
conf-dir=/tmp/dnsmasq.d
user=dnsmasq
group=dnsmasq


dhcp-ignore-names=tag:dhcp_bogus_hostname
conf-file=/usr/share/dnsmasq/dhcpbogushostname.conf


bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
dhcp-range=set:lan,192.168.1.200,192.168.1.254,255.255.255.0,12h
no-dhcp-interface=eth2

What am I doing wrong? Neither the filename, serveraddress not force appears in the config file.
Manually restarting dnsmasq does not help.

Setting the servername option is a must.

https://openwrt.org/docs/guide-user/base-system/dhcp#booting_options

2 Likes

dnsmasq itself on OpenWrt can also be a TFTP server, if you have the disk space. That is enabled with the enable_tftp and tftp_root options in the main dnsmasq section.

Thank you!
I added servername, removed force and I now have a line add to the /var/etc/dnsmasq.conf.cfg01411c file:
dhcp-boot=pxelinux.0,systemrescuecd,192.168.1.5
and have successfully booted into systemrescuecd via PXE.
I've looked at that boot config page before and feel a little embarrassed for missing the 'Required Yes' against servername.
I meant to add the openwrt version I am using in my test environment is 22.03.2 and I have also proved it works with 22.03.0 on my live environment.

Thank you again for your help.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.