What's new

Debug DHCP with AdguardHome Enabled

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

ptocadoa

Occasional Visitor
Another simple question, difficult to know if it has been answered before: DHCP debug with Adguard enabled

I have been using AdguardHome with my AX58....but I think it redirects my dnsmasq logs to process the dns queries.
I am using new devices at home and I want to see the DHCP queries they are doing. I want to see the IP events for ACK, NACK, RELEASE...

How can I see them? My dnsmasq.log only says this:

Jan 18 16:28:37 ax58u dnsmasq-dhcp[8446]: DHCP, IP range 192.168.102.2 -- 192.168.102.254, lease time 1d
Jan 18 16:28:37 ax58u dnsmasq-dhcp[8446]: DHCP, IP range 192.168.101.2 -- 192.168.101.254, lease time 1d
Jan 18 16:28:37 ax58u dnsmasq-dhcp[8446]: DHCP, IP range 192.168.1.224 -- 192.168.1.254, lease time 1d
Jan 18 17:37:15 ax58u dnsmasq-dhcp[25893]: DHCP, IP range 192.168.102.2 -- 192.168.102.254, lease time 1d
Jan 18 17:37:15 ax58u dnsmasq-dhcp[25893]: DHCP, IP range 192.168.101.2 -- 192.168.101.254, lease time 1d
Jan 18 17:37:15 ax58u dnsmasq-dhcp[25893]: DHCP, IP range 192.168.1.224 -- 192.168.1.254, lease time 1d
 
Another simple question, difficult to know if it has been answered before: DHCP debug with Adguard enabled

I have been using AdguardHome with my AX58....but I think it redirects my dnsmasq logs to process the dns queries.
I am using new devices at home and I want to see the DHCP queries they are doing. I want to see the IP events for ACK, NACK, RELEASE...

How can I see them? My dnsmasq.log only says this:

Jan 18 16:28:37 ax58u dnsmasq-dhcp[8446]: DHCP, IP range 192.168.102.2 -- 192.168.102.254, lease time 1d
Jan 18 16:28:37 ax58u dnsmasq-dhcp[8446]: DHCP, IP range 192.168.101.2 -- 192.168.101.254, lease time 1d
Jan 18 16:28:37 ax58u dnsmasq-dhcp[8446]: DHCP, IP range 192.168.1.224 -- 192.168.1.254, lease time 1d
Jan 18 17:37:15 ax58u dnsmasq-dhcp[25893]: DHCP, IP range 192.168.102.2 -- 192.168.102.254, lease time 1d
Jan 18 17:37:15 ax58u dnsmasq-dhcp[25893]: DHCP, IP range 192.168.101.2 -- 192.168.101.254, lease time 1d
Jan 18 17:37:15 ax58u dnsmasq-dhcp[25893]: DHCP, IP range 192.168.1.224 -- 192.168.1.254, lease time 1d
You need to look at DNSMASQ manpage:
Find the appropriate options you need to enable, and add them to /jffs/configs/dnsmasq.conf.add.

The only thing the Asuswrt-Merlin AdGuardHome Init script does is move dnsmasq's DNS port from port 53 to 553. This does not change any of the actual DHCP logging features of it. Only the DNS server aspect. The rest of the DNSMASQ configurations are for you to figure out. There is an option to enable query log on the Asuswrt webui LAN DHCP page. That is all I got. If that doesn't work, try asking this same DHCP question on the Asuswrt-Merlin forum thread where it is likely going to get the desired answer and attention.
 
Last edited:
Hello again,
I am sure there are more changes apart from the port because before I installed it, I was able to debug the DHCP leases.
 
Hello again,
I am sure there are more changes apart from the port because before I installed it, I was able to debug the DHCP leases.
You are welcome to think that. Maybe you can even prove me wrong. But, I just looked at the init script and all I see is where it put in the appropriate dns changes. Nothing associated with adjusting the dhcp query logging or ra. Do you perhaps remove another developers script before installing adguardhome? Like diversion Maybe?
 
@ColinTaylor, when I saw your reply, I went quickly to the option you mentioned..but didn't found it!.
So, as I saw installed uiscribe ...I uninstalled it.
But unfortunately, although I can see logs under ssh shell, the dnsmasq logs still do not show the info I need.
 
@ColinTaylor, when I saw your reply, I went quickly to the option you mentioned..but didn't found it!.
So, as I saw installed uiscribe ...I uninstalled it.
But unfortunately, although I can see logs under ssh shell, the dnsmasq logs still do not show the info I need.
Did you also uninstall Scribe or just UiScribe? I'd guess that Scribe might still be redirecting the DHCP logs.
 
Something about the logging has been changed. Although I set do not hide in the UI (upper left), the shell (down) does not show the dns queries that adguard shows (upper right):
1674143249116.png
 
Effectively @ColinTaylor...I misread
I have also uninstalled scribe and right now, dnsmasq.log shows DHCPREQUEST and DHCPACK !
I used scribe to rotate logs. In fact, I will try to install it again and will watch over it.

Thanks @ColinTaylor and @SomeWhereOverTheRainBow, as you have shown me the way
Yep if I recall correctly, they chose not to filter dhcp or dnsmasq logs with scribe because of the heavy log traffic and upkeep. If you plan to look at those logs, I suggest looking at dnsmasq manpage to see if there is a simple way for you to have dnsmasq output them to a separate log space that you control. From there, it should be as simple as tailing the log.
 
... If you plan to look at those logs, I suggest looking at dnsmasq manpage to see if there is a simple way for you to have dnsmasq output them to a separate log space that you control. From there, it should be as simple as tailing the log.
Yeah, that's usually what I would do when debugging/testing some changes in dnsmasq configuration: output to a separate debug log file that I can monitor more easily.

To set a separate dnsmasq logfile for a short-term testing/debugging session to monitor the "Discover/Offer/Request/Acknowledge" (DORA) process used by DHCP, you can set the "log-facility" option in the command line to point to a custom file path (the folder path must exist already).

For example:
Bash:
killall dnsmasq 2>/dev/null
dnsmasq --log-async=25 --log-debug --log-dhcp --log-facility="/opt/tmp/log/dnsmasq.DEBUG.log"
ps | grep dnsmasq | grep -v "grep dnsmasq"

Once you've finished testing/debugging, you can restart dnsmasq to reset to defaults:
Bash:
service restart_dnsmasq

To make the options permanent so they survive a reboot, you can instead place them in the "/jffs/configs/dnsmasq.conf.add" file.
Bash:
log-dhcp
log-debug
log-async=25
log-facility="/opt/tmp/log/dnsmasq.DEBUG.log"

Note that the debug log file size can grow large fairly quickly, depending on the number of network clients you have, their DHCP lease times, the amount of network activity & other factors so, as a general rule, you want to make/add the above changes *only* for debugging/testing purposes, and *only* for a few days, maybe 3 to 5 at most. The possible large size (several MBytes) is the main reason I choose to set the location of the debug log file on my USB drive attached to the router (e.g. /opt/tmp/log/) where I have a lot of storage space.

HTH
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top