Hi all,
I'm setting up a complex dnsmasq configuration.
Let me explain:
I have a Tp-Link TL-WR1043ND v3, with OpenWRT 23.05.0.
I have 2 interfaces.
1 is called lan
, assigned to VLAN1 ports (the 4 LAN ports in the switch).
The other is called mgmt
, assigned to VLAN2 (the WAN port in the switch).
lan
is configured with IP address to be set as a dhcp client, and with dhcp server disabled.
mgmt
is configured with static IP address, and dhcp server enabled.
I want to configure dhcp/dnsmasq to still serve normal DHCP in mgmt
interface, and act as proxyDHCP in lan
interface. I have been configuring another ProxyDHCP server in a Ubuntu server, so I am familiarized with dnsmasq configurations. (if you want to see my previous investigation with dnsmasq, see AskUbuntu post).
It may seem strange why I want these configurations but I do have a reason for wanting to do this. I will likely expand my target setup in a later message, so you understand why I need these things.
I had already talked with @pavelgl in another post in this forum - openwrt - other post. Hi pavel! - and he told me how to configure dnsmasq to act as DHCP/PXE server (complete functionality, not just ProxyDHCP). Following this thread I could configure a normal DHCP server like that, but in this case I want two different configurations, one for each interface and this gets complex. So for example, if I clear up /etc/config/dhcp
and edit /etc/dnsmasq.d/client_arch.conf
, I wouldn't know how to configure for 2 different interfaces... it's far complex.
Let me show you the configuration I have in /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'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ignore '1'
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'
And the configuration at /etc/dnsmasq
:
#enable TFTP server and set its root path
enable-tftp
tftp-root=/pxe
#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
This configuration should only apply to the lan
interface.
Can anybody guide me on how to do this configuration?
Thanks.