Complex dnsmasq configuration

Hi again everyone!

I finally got to successfully configure dnsmasq for the purposes that I needed.
I'm writing down it here, just in case anyone finds it useful for his own case or whatever.

I had to restart OpenWRT to the default values, because I thought some configuration was wrong somewhere, and I didn't find the cause. Anyway, the final configuration was not the same that I was doing in previous messages.

In the /etc/config/dhcp file, I finally didn't need two dnsmasq instances. I only left the dhcp pool for mgmt interface present, and no dhcp pool for lan. This way, the lan interface doesn't have DHCP server functionality (from OpenWRT). Also the tftp server was configured from this file, while the other PXE configurations were configured from /etc/dnsmasq.d/pxe.conf. I tried to activate TFTP from /etc/dnsmasq.d/pxe.conf, but it didn't work.

Content from /etc/config/dhcp:

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'
        option confdir '/etc/dnsmasq.d'
        option enable_tftp '1'
        option tftp_root '/pxe'

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

config dhcp 'mgmt'
        option interface 'mgmt'
        option start '100'
        option limit '150'
        option leasetime '12h'

Content from /etc/dnsmasq.d/pxe.conf:

#enable ProxyDHCP server. The address 192.168.1.0 corresponds to the subnet in which the ProxyDHCP server will act
dhcp-range=192.168.1.0,proxy,255.255.255.0

# bios
pxe-service=x86PC,"Network Boot BIOS",firmware/ipxe.pxe

# uefi
pxe-service=X86-64_EFI,"Network Boot UEFI x86_64",firmware/ipxe.efi

Thus, I finally got the dnsmasq part of my PXE portable server to work. Now I have another issues related to iPXE configuration, but those things are out of the scope of this thread.

Thanks anybody for your help.

Greets