Dnsmasq lease reservation question

I've seen this around and am a bit confused. I am currently running ddwrt on my home LAN. Been having some issues, so I decided to look at OpenWrt. I was able to get it loaded on my Router no problem, and was looking at moving over all the special things I have set up. One is OpenVPN and that seems to be well covered. I have not yet embarked on that as the more pressing thing is DHCP reservations. I have a lot of devices on my network and have a big DNSMASQ configuration which reserves the IPs for the known MACs on m LAN. Also, I have a tftp server and a PXE boot config. How do I put in a simple list in a txt file somewhere with the absic dnsmasq settings? i.e.

dhcp-host=xx:xx:xx:xx:xx:xx,iPhone,192.168.2.xx,infinite

and:

dhcp-range=192.168.2.10,192.168.2.249,255.255.255.0,24h
dhcp-match=x86_pc, option:client-arch, 0 #BIOS x86
dhcp-match=efi_64, option:client-arch, 7 #EFI x86-64
#dhcp-boot=tag:x86_pc, pxelinux.0,nas,192.168.2.xxx
dhcp-boot=tag:x86_pc, x86_pc/pxelinux.0,nas,192.168.2.xxx
dhcp-boot=tag:efi_64, x64_efi/syslinux.efi,nas,192.168.2.xxx
dhcp-option=3,192.168.2.1
dhcp-option=6,192.168.2.1
dhcp-option=66,"192.168.2.xxx"

I just want to edit a txt file and put these 'standard' dnsmasq settings in. Can it be done this simply?

Regards,

Keith

The first page should cover your questions.
https://openwrt.org/docs/guide-user/base-system/dhcp.dnsmasq

1 Like

Are you saying that i can put regular dnsmasq statements in the /etc/dnsmasq.conf file as I outlined above?

From the page:

The configuration is done with help of the uci-configuration file: /etc/config/dhcp , but you can use this together with the file /etc/dnsmasq.conf .
It is possible to mix the traditional /etc/dnsmasq.conf configuration file with the options found in /etc/config/dhcp .
The dnsmasq.conf file does not exist by default but will be processed by dnsmasq on startup if it is present. Note that options in /etc/config/dhcp take precendence over dnsmasq.conf since they are translated to command line arguments.

1 Like

A simple yes would suffice.

I am trying to move to openwrt from ddwrt and am struggling to wrap my head around the differences and how I can move my setup to this new system. I do appreciate any help, but this is a bit complicated to dig through as I try to move my complex home system to openWRT..

SO, in summary, if you are so inclined to put your DHCP reservations in a text file, all you need to do is edit the /etc/dnsmasq.conf file from the SSH login and add lines for each reservation you want to have in the standard dnsmasq format:
dhcp-host=XX:XX:XX:XX:XX:XX,name,ip_address,infinite

example:
dhcp-host=D4:63:C6:0E:4A:8A,my_iphone,192.168.0.101,infinite

Keith

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

That will work, but it is not the recommended practice.

DHCP reservations are fully supported by OpenWrt's UCI system. The web interface has a Network-- DHCP and DNS -- Static Leases page to enter the lease details directly. These end up in /etc/config/dhcp. CLI users should enter the settings in /etc/config/dhcp as config host sections (see https://openwrt.org/docs/guide-user/base-system/dhcp#static_leases)

Just before dnsmasq is started, that file is parsed to generate a dnsmasq-format configuration in /var/etc (on the RAM disk). OpenWrt's philosophy is to concentrate most or all user settings in /etc/config/* in a unified format, then on the fly produce RAM based application-specific configuration files at runtime.

/etc/dnsmasq.conf is referenced as an include in the generated file, as a hook for possible esoteric configurations that the existing UCI scripts cannot handle. Ordinarily /etc/dnsmasq.conf contains only commented-out lines, and unless there is a good reason it should stay that way.

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