Dnsmasq very chatty

I must admit to not knowing the internals of DHCP on linux all that well, particularly for IPv6. I'm running davidc502's build for WRT32X and with IPv6 enabled it seems to be the standard config to dnsmasq and odhcpd both running and I have the " config odhcpd 'odhcpd' " entry in my " /etc/config/dhcp "

If it's possible to do v4 and v6 DHCP from the same daemon, it would make sense to do so, I imagine!

Are you sure you don't have an odhcp section? Mine was way down the file, mixed in with static IP reservations for some reason.

Contents of that script are the same for me.

So my understanding is that dnsmasq was the 'original' combined DNS and DHCP server for OpenWRT because it had a smaller footprint than odhcp. However odhcp was introduced to allow DHCPv6 support.

Was there any logic to the decision of keeping dnsmasq doing DHCP(v4) instead of moving it all to odhcp?

Well, dnsmasq also (primarily?) handles DNS and RA, of course, so those functions would need to be replaced, too, if you wanted rid of dnsmasq :thinking:

https://openwrt.org/docs/guide-user/base-system/dhcp_configuration

There is a guide here on how to make dnsmasq do DNS/RA only and setup odhcp to service DHCPv4 and DHCPv6

edit - well actually they are two separate guides, one on disabling dnsmasq's DHCP function and one on removing dnsmasq and installing odhcp for DHCPv4 and v6. With a bit of mix and match it should be possible to have dnsmasq do DNS only and odhcp do all DHCP.

I can't try this right now, but generally it should go...

uci set dhcp.lan.ignore="1"
uci commit dhcp
service dnsmasq restart
service odhcpd restart

Then

opkg update
opkg remove odhcpd-ipv6only
opkg install odhcpd
uci set dhcp.lan.dhcpv4="server"
uci set dhcp.odhcpd.maindhcp="1"
uci commit dhcp
service odhcpd restart
2 Likes

On my node unbound handles DNS and odhcpd dhcp4/6 with one


dnsmasq can also handle dhcp6 if you prefer to get rid of odhcpd.

How can you make dnsmasq do DHCPv6? If this is possible, why did OpenWRT end up with this weird hybrid model with dnsmasq and odhcp?

perhaps there are some (performance?) benefits to deploy odhcpd for downstream dhcp6. Notwithstanding odhcp6c handling upstream dhcp6.


else web search https://hveem.no/using-dnsmasq-for-dhcpv6

Mainly because dnsmasq does not allow for dynamic IPv6 prefix management. You either need to let it handle everything autonomously, breaking many system integrations or you have to frequently pregenerate updated configs for it and restart the process, leading to a loss of state.

4 Likes

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

options for dhcp sections.

Name: `dhcpv6`
Type:
string
Required:
no
Default:
(none)

Description: 
Specifies whether DHCPv6 server should be enabled ( `server` ), relayed ( `relay` ) or disabled ( `disabled` )

So if you use odhcp for all DHCP, do you lose any integrations/functionality (other than NTP advertisements as noted by @anon45274024).

just as general note on cluttered system logs I am using syslog-ng to filter out from the main log whatever I want out of it, e.g.

filter {
  		not (facility(kern) and match("DROP" value("MESSAGE")));
  		not (program(sshd) or program(cron) or  program(odhcpd) or program(dnsmasq));
  	};

and get it written into separate logs files (that are not conveniently accessible via LuCI though but only through ssh file browser). Maybe one day there will be a LuCI file browser :slight_smile:

I looked again, and I do have that section, too... sorry. I even have the same trigger option there.

What I can confirm is that I do not see those messages on the logs.

@WiteWulf, @supersebbo, This is slightly OT, but in fact very relevant to that long-duration open bug report. Simon Kelley (author of dnsmasq) has worked solo to build the package across all sorts of devices, architectures, kernels, etc. His work is not funded by anyone, he's working very hard, and he's making decisions about where to focus.

Eric Raymond (esr) had started a social network to provide funding to those "Load Bearing Internet People". He discusses it in his blog posting Loadsharers: Funding the Load Bearing Internet People Consider funding some of the people on his list (like Simon). Thanks.

3 Likes

Absolutely respect his work and it wasn't a dig at him. In fact this 'bug', as noted above, is nothing to do with dnsmasq, rather the OpenWRT default config of using two different DHCP servers side by side.

I agree, and wasn't criticizing. I just wanted to publicize the Loadsharers so people like Simon might get support. (I'll put a longer stand-alone note on the Forum soon...) Thank you.

For a simple home network would turning off IPv6 by disabling oducpd be OK?
Sorry if this is a really dumb question.

Why do you want to disable it?
In any case, you can't easily disable IPv6 LLA.

I have a similar problem to that described above, lots of host reloads and a large(ish) adblock list that causes the router to have a little think and holding up traffic.