Adblock for DD-WRT (version 2)

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Goto page Previous  1, 2, 3 ... 20, 21, 22
Author Message
AbsenteeUser1
DD-WRT Novice


Joined: 10 Nov 2021
Posts: 2

PostPosted: Wed Nov 10, 2021 8:27    Post subject: Reply with quote
I also have a Tp Link Archer AC1750 C7 version 2. r47206 standard. But I don't have a button in services to enable local DNS. Maybe there is a dnsmasq option someone knows I could add after
bogus-priv
domain-needed
addn-hosts=/jffs/dnsmasq/mphosts
conf-file=/jffs/dnsmasq/mpdomains

But wait, when I run the script ./adblock.sh -2 -i ip=127.0.0.1
[INFO] Size of /tmp/mphosts.tmp: 28.4M
[INFO] Size of /tmp/mpdomains.tmp: 10.8M
[INFO] Size of /jffs/dnsmasq/mphosts: 17.0M
[INFO] Size of /jffs/dnsmasq/mpdomains: 0
Domains are not copied over unless ip is left as default. So I am able to get this partially working by omitting the conf-file. Any suggestions to get this fully working on Archer C7?
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 11128
Location: Texas, USA

PostPosted: Wed Nov 10, 2021 15:24    Post subject: Reply with quote
Add router address as local DNS server on main setup page; local DNS should be enabled by default.
_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware‽
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is‽
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
sarahedmonds
DD-WRT Novice


Joined: 16 Nov 2021
Posts: 1

PostPosted: Tue Nov 16, 2021 3:55    Post subject: Reply with quote
I have a reasonably new router (AC1750, dd-wrt v3.0-r43904), and adblock.sh configured to use "blitz=0" lists. No Optware, Entware, etc.

I'm having a weird error when dnsmasq goes to start up. It invisibly exits, with error code 2, when the normal process starts. However, starting the process either in debug mode or in the foreground (-k) works perfectly fine. Any ideas or tips on trying to debug this?

Here is my generated config:

Code:
Code:
interface=br0
resolv-file=/tmp/resolv.dnsmasq
strict-order
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=52
dhcp-option=br0,3,192.168.170.1
dhcp-authoritative
dhcp-range=br0,192.168.170.100,192.168.170.149,255.255.255.0,1440m
dhcp-host=30:9c:23:29:93:db,main-sl,192.168.170.25,60m
bogus-priv
conf-file=/etc/rfc6761.conf
stop-dns-rebind
dhcp-option=252,"\n"
# Having a large local cache speeds up subsequent DNS queries significantly (from several hundred msec to around 25-30)
# You may need to adjust this depending on the amount of free space you have
cache-size=10000
# This forces Dnsmasq to query each of the DNS servers below in the order they appear, rather than randomly (default)
strict-order
server=8.8.8.8 # Google DNS, but can be anything you prefer
server=8.8.4.4
conf-file=/jffs/dnsmasq/mpdomains
addn-hosts=/jffs/dnsmasq/mphosts
domain-needed
AbsenteeUser1
DD-WRT Novice


Joined: 10 Nov 2021
Posts: 2

PostPosted: Fri Nov 26, 2021 15:10    Post subject: Reply with quote
I went through all the hoops getting this up and running. One thing that threw me off others may find helpful is that the command " sh adblock.sh -s2 " works and is equivalent to the " ./ adblock.sh -s2 " used in the OP. I had to be able to use either command after testing multiple older (r36000 to r39000) builds on an wndr3700r4 and an archer c7v2 (ac1750).

What I can suggest is saving your config or jotting it down and trying some different (older) builds for your router. Don't reset after flashing and when you find a build that seems to work after some period, then reset to default.

I searched for methods to enable more detailed logging or how to look through (what to look for in) the directories on the router to debug certain processes and couldn't find anything useful and actually found that to get any more detailed logging is disabled or unavailable in dd-wrt.

I did a time cost benefit analysis and determined trying new builds would be faster than struggling to understand all the ins and outs of a dd-wrt process and how to debug it.

After bugs with different builds, I ended up getting it running nicely on a wndr3700r4 build r36410 with services:
-usb core support working
-/jffs and /opt mounted properly at each startup
-local DNS working and not overloading CPU
-Upnp working and not dying and restarting
-wireless tested working (but is disabled)
-mpdomains coping over to /jffs/dnsmasq/mpdomains after adblock.sh downloads it
-conf-file=/jffs/dnsmasq/mpdomains not overloading CPU after adding it to Services -> Additional Dnsmasq Options window.

Here is my dnsmasq.conf file:

interface=br0
resolv-file=/tmp/resolv.dnsmasq
strict-order
domain=gateway.sasktel.net
leasefile-ro
dhcp-script=/etc/lease_update.sh
dhcp-lease-max=99
dhcp-option=br0,3,192.168.1.254
dhcp-range=br0,192.168.1.1,192.168.1.99,255.255.255.0,9999m
bogus-priv
conf-file=/etc/rfc6761.conf
stop-dns-rebind
domain-needed
bind-interfaces
no-negcache
cache-size=2500
rebind-localhost-ok
addn-hosts=/jffs/dnsmasq/mphosts
conf-file=/jffs/dnsmasq/mpdomains

PS adding bogus-priv to the Services -> Additional Dnsmasq Options window causes a duplicate entry in /tmp/dnsmasq.conf and maybe should be removed in the OP or at least mentioned.


Last edited by AbsenteeUser1 on Fri Nov 26, 2021 15:17; edited 1 time in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 8597
Location: Netherlands

PostPosted: Fri Nov 26, 2021 15:17    Post subject: Reply with quote
If you start with: sh -x
(b)ash will enter debug mode

You can also set the following in the beginning of the script:
set -x

Have fun Smile

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
WireGuard Documents & Guides:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397
OpenVPN Documents & Guides: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327398
IPSET: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 11128
Location: Texas, USA

PostPosted: Fri Nov 26, 2021 18:24    Post subject: Reply with quote
Quote:
PS adding bogus-priv to the Services -> Additional Dnsmasq Options window causes a duplicate entry in /tmp/dnsmasq.conf and maybe should be removed in the OP or at least mentioned.

Indeed, this was a default config change that I was oblivious to until recently. The OP was written before this change, so tracking down the change and properly editing the OP to include delineating information on this specific "on build xxxxx and older, use this line and on build xxxxx and newer, do not use this line" annotation. I would do it, but I do not have the access to do so.

_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware‽
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is‽
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
Goto page Previous  1, 2, 3 ... 20, 21, 22 Display posts from previous:    Page 22 of 22
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum