OpenWrt Forum Archive

Topic: Dnsmasq in WhiterussianRC2 question

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

Hi,
I wonder why the dnsmasq is always (regardless of config file contents) run with DHCP enabled on LAN interface. What is the reason?

It checks for an existing dhcp server, and if it finds one, it quits. Anyway, it acts as a dhcp server by default because most of the ppl want it that way. Can't see Your problem, as You can freely disable it, or even make Your own image that only does what You want.

Hi,

in the standart-configuration dnsmasq will be start with dhcp-options, investigated by /etc/init.d/S50dnsmasq from nvram variables. Looking in S50dnsmasq you will see what nvram variabes will be use to configure dhcp.
To use the /etc/dnsmasq.conf script, start dnsmasq without arguments.

Do change S50dnsmasq like this:
------------/etc/init.d/S50dnsmasq---------
#!/bin/sh
/usr/sbin/dnsmasq

-----------------------------------------------

then you can use dnsmasq.conf to configure dnsmasq and should can disabled dhcp.

I can read shell scripts myself, 8 years of using Linux provided me with enough knowledge, thanks.
Anyway, I haven't said that there is a problem, it's just something new and I don't get the idea behind it - I used to configure dnsmasq using configuration file without any "hardcoded defaults" in init script and it worked too (moreover it was easier - read more straightforward - to disable DHCP).
I see that I did not make myself clear before. I didn't want to know why the DHCP is run at all, I wanted to know why one part of DHCP configuration was moved to init script. It only makes sense for people who change LAN address and forget to change dnsmasq.conf (i.e. they do not know exactly what they are doing) but I thought that such (quite inexperienced) people won't use OpenWRT for it's lack of web-based configuration interface. Howgh :-)

The discussion might have continued from here.