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?
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
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.
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
Joined: 08 May 2018 Posts: 12425 Location: Texas, USA
Posted: Fri Nov 26, 2021 18:24 Post subject:
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.
OPERATION:
[-0] BLITZ=0: safe minimum protection
[-1] BLITZ=1: increased protection [DEFAULT]
[-2] BLITZ=2: optimum protection
[-3] BLITZ=3: unlock maximum protection
[-f] Block Facebook and Messenger services
[-F] Block Facebook, Messenger, Instagram, WhatsApp
[-d | -D] Ignore myblacklist/mywhitelist entries
[--debug] Debug the script in case of errors
[--wget] Force use of wget even if cURL is available
[--remote=]remote.ip Update your system remotely; default: 192.168.1.1
[-b | --bl=]domain.name Add domain.name to myblacklist
[-w | --wl=]domain.name Add domain.name to mywhitelist
[-i | --ip=]ip.ad.dr.ss Send ads to this IP; default: 0.1.2.3
[-p | --pause] Pause protection
[-r | --resume] Resume protection
[-s | --secure] Use cURL CA certs for secure file transfer
[-o | --offline] Process local lists without downloading
[-h | --help] Display this help screen and exit
[-u | --update] Update adblock.sh to the latest version
[-v | --version] Print adblock.sh version and exit
Jan 1 02:00:24 DD-WRT user.info : [radvd] : RADVD daemon successfully started
Jan 1 02:00:24 DD-WRT user.info : [dropbear] : ssh daemon successfully started
Jan 1 02:00:24 DD-WRT authpriv.info dropbear[1363]: Running in background
Jan 1 02:00:24 DD-WRT user.info : [wland] : daemon successfully started
Jan 1 02:00:24 DD-WRT user.info : [cron] : daemon successfully started
Jan 1 02:00:24 DD-WRT cron.info cron[1368]: (CRON) STARTUP (fork ok)
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: started, version 2.87test8 cachesize 1500
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua no-TFTP no-conntrack ipset no-nftset no-auth cryptohash DNSSEC loop-detect inotify no-dumpfile
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq-dhcp[1380]: DHCP, IP range 192.168.1.64 -- 192.168.1.159, lease time 1d
Jan 1 02:00:24 DD-WRT user.info : [dnsmasq] : daemon successfully started
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for test
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for onion
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for localhost
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for local
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for invalid
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for bind
Jan 1 02:00:24 DD-WRT daemon.warn dnsmasq[1380]: no servers found in /tmp/resolv.dnsmasq, will retry
Jan 1 02:00:24 DD-WRT daemon.info dnsmasq[1380]: read /etc/hosts - 2 addresses
Jan 1 02:00:24 DD-WRT daemon.err dnsmasq[1380]: failed to load names from /jffs/dnsmasq/mphosts: No such file or directory
Jan 1 02:00:25 DD-WRT daemon.info pppd[1526]: Plugin /usr/lib/rp-pppoe.so loaded.
Jan 1 02:00:25 DD-WRT daemon.notice pppd[1528]: pppd 2.4.8 started by root, uid 0
Jan 1 02:00:25 DD-WRT user.info : [ppp_redial] : redial process successfully started
Jan 1 02:00:25 DD-WRT user.info : [ttraff] : traffic counter daemon successfully started
Jan 1 02:00:25 DD-WRT user.info : [radio_timer] : radio timer daemon successfully started
Jan 1 02:00:25 DD-WRT daemon.info httpd[1538]: [httpd] : httpd server started at port 80
Jan 1 02:00:25 DD-WRT user.info : [httpd] : http daemon successfully started
Jan 1 02:00:25 DD-WRT user.info : [resetbutton] : daemon successfully stopped
Jan 1 02:00:25 DD-WRT user.info : [resetbutton] : resetbutton daemon successfully started
Jan 1 02:00:26 DD-WRT user.info : [httpd] : daemon successfully stopped
Jan 1 02:00:26 DD-WRT daemon.info httpd[1544]: [httpd] : httpd server shutdown
Jan 1 02:00:26 DD-WRT daemon.info httpd[1565]: [httpd] : httpd server started at port 80
Jan 1 02:00:26 DD-WRT user.info : [httpd] : http daemon successfully started
Jan 1 02:00:27 DD-WRT daemon.info pppd[1528]: Using interface ppp0
Jan 1 02:00:27 DD-WRT daemon.notice pppd[1528]: Connect: ppp0 <--> eth0
Jan 1 02:00:29 DD-WRT user.notice WDS_Watchdog[1698]: Started
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: PAP authentication succeeded
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: peer from calling number authorized
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: local IP address
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: remote IP address 10.0.0.1
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: primary DNS address
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: secondary DNS address
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: reading /tmp/resolv.dnsmasq
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using nameserver #53
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using nameserver #53
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for test
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for onion
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for localhost
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for local
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for invalid
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: using only locally-known addresses for bind
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: read /etc/hosts - 2 addresses
Jan 1 02:00:30 DD-WRT daemon.err dnsmasq[1380]: failed to load names from /jffs/dnsmasq/mphosts: No such file or directory
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: local LL address
Jan 1 02:00:30 DD-WRT daemon.notice pppd[1528]: remote LL address
Jan 1 02:00:30 DD-WRT user.info : [wland] : daemon successfully stopped
Jan 1 02:00:30 DD-WRT user.info : [wland] : daemon successfully started
Jan 1 02:00:30 DD-WRT user.info : [wan] : WAN is up. IP: 86.124.111.107
Jan 1 02:00:30 DD-WRT user.info : [dnsmasq] : daemon successfully stopped
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1380]: exiting on receipt of SIGTERM
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: started, version 2.87test8 cachesize 1500
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: compile time options: IPv6 GNU-getopt no-DBus no-UBus no-i18n no-IDN DHCP DHCPv6 no-Lua no-TFTP no-conntrack ipset no-nftset no-auth cryptohash DNSSEC loop-detect inotify no-dumpfile
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq-dhcp[1735]: DHCP, IP range 192.168.1.64 -- 192.168.1.159, lease time 1d
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for test
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for onion
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for localhost
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for local
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for invalid
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for bind
Jan 1 02:00:30 DD-WRT user.info : [dnsmasq] : daemon successfully started
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: reading /tmp/resolv.dnsmasq
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using nameserver #53
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using nameserver #53
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for test
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for onion
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for localhost
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for local
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for invalid
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: using only locally-known addresses for bind
Jan 1 02:00:30 DD-WRT daemon.info dnsmasq[1735]: read /etc/hosts - 2 addresses
Jan 1 02:00:30 DD-WRT daemon.err dnsmasq[1735]: failed to load names from /jffs/dnsmasq/mphosts: No such file or directory
Jan 1 02:00:30 DD-WRT user.info : [radvd] : daemon successfully stopped
Jan 1 02:00:30 DD-WRT daemon.warn radvd[1352]: exiting, 1 sigterm(s) received
Jan 1 02:00:30 DD-WRT daemon.info radvd[1352]: sending stop adverts
Jan 1 02:00:30 DD-WRT daemon.info radvd[1352]: removing /var/run/radvd.pid
Jan 1 02:00:30 DD-WRT daemon.info radvd[1352]: returning from radvd main
Jan 1 02:00:30 DD-WRT daemon.info radvd[1736]: version 2.19 started
Jan 1 02:00:30 DD-WRT user.info : [radvd] : RADVD daemon successfully started
Jan 1 02:00:30 DD-WRT user.info : [vpn modules] : vpn modules successfully unloaded
Jan 1 02:00:30 DD-WRT user.info : [vpn modules] : nf_conntrack_proto_gre successfully loaded
Jan 1 02:00:30 DD-WRT user.info : [vpn modules] : nf_nat_proto_gre successfully loaded
Jan 1 02:00:30 DD-WRT user.info : [vpn modules] : nf_conntrack_pptp successfully loaded
Jan 1 02:00:30 DD-WRT user.info : [vpn modules] : nf_nat_pptp successfully loaded
Jan 1 02:00:30 DD-WRT user.info : [process_monitor] : successfully started
Jan 1 02:00:32 DD-WRT user.info : [cron] : daemon successfully stopped
Jan 1 02:00:33 DD-WRT user.info : [cron] : daemon successfully started
Jan 1 02:00:33 DD-WRT cron.info cron[2006]: (CRON) STARTUP (fork ok)
Jan 1 02:00:33 DD-WRT daemon.debug ntpclient[1911]: Connecting to 2.pool.ntp.org [] ...
Apr 17 18:05:43 DD-WRT daemon.info ntpclient[1911]: Time set from 2.pool.ntp.org [].
Apr 17 18:05:43 DD-WRT daemon.info process_monitor[1910]: cyclic NTP Update success (servers 2.pool.ntp.org )
Apr 17 18:05:43 DD-WRT user.info : [cron] : daemon successfully stopped
Jan 1 02:00:30 DD-WRT daemon.err dnsmasq[1380]: failed to load names from /jffs/dnsmasq/mphosts: No such file or directory
How do I solve this problem? _________________ Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS RCS & RDS 1Gbps
Linksys WRT1900ACS v.2 -OpenWrt/DD-WRT
WDR3600 rev.1.5 - OpenWrt
Posted: Tue May 17, 2022 20:19 Post subject: Re: Adblock for DD-WRT (version 2)
don't have anything to say just want the openVPN guide which requires me to post at least once. feel free to delete this..
Yamaraj wrote:
Adblock for DD-WRT
--------------------------------
Script for blocking ads on DD-WRT
Developed and tested on: NETGEAR R8500 / R7800
Hardware requirements: Minimum 4GB USB drive.
Partitioned, formatted, and mounted as swap (256-512MB), /jffs (1-2GB), and /opt (1-2GB)
NOTE: DO NOT try to run this script on your internal jffs.
Software requirements: DD-WRT , cURL (with entware if unavailable with your firmware)
Installation:
-------------
1.
Code:
cd /jffs/dnsmasq
2.
Code:
curl -o adblock.sh adblock.sh
or
Code:
wget -O adblock.sh adblock.sh
2.
Code:
chmod +x adblock.sh
3. Use --update or -u command line option to update to the latest version.
Settings:
---------
1. Disable internal flash (JFFS2) if it's enabled.
2. Enable DNSMasq and local DNS for LAN and WAN. Add these lines under the additional options section.
3. Enter additional options for dnsmasq if required, for example:
Code:
domain-needed
bogus-priv
4. Under Administration -> Cron, enter this or choose your own schedule (this executes this script on Mondays and Thursdays at 0600 hours):
Code:
0 6 * * 1,4 root /jffs/dnsmasq/adblock.sh
5. Reboot
Usage:
------
1. Add your custom blacklist or whitelist domains to myblacklist and mywhitelist files respectively.
2. Do not save anything in blacklist or whitelist files as they will be overwritten every
time the script is executed.
--
Changelog:
20200201:
MAJOR UPGRADE. Now supports remote operations as well. If your router is not powerful enough to run this script, you can now install this on a Linux system/Raspberry Pi and use the --remote=(router ip address) option to upload generated lists via SSH. Note that this mode is interactive and you will asked for your router's root password (not saved anywhere). To automate this, you can configure router with ssh keys.
Automatic fallback to wget if curl is unavailable. Not recommended though as BusyBox wget is severely limited in functionality and scope.
This release also supports DEBUG output if you face any errors. Check command line options.
adbhostgen (old version) is still functional and will remain so for a while. No new features will be added to this, so I recommend that you upgrade and change "adbhostgen.sh" to "adblock.sh" on all the relevant config pages.
20180331:
POINT RELEASE with all the bugfixes and new features from the alpha releases below.
20180329a2:
No more "bad name at line n" errors.
20180328a2:
Changed default ad destination IP from 0.0.0.0 to 0.1.2.3
20180327a1:
New options:
-i <ip-address>
--ip=<ip-address>
where <ip-address> is an IPv4 address of your own personal ad hell.
20180326a1:
New options:
-f, blocks Facebook.com and services
-F, blocks Facebook, Instagram, and WhatsApp
20180324a6:
Significant changes and bugfixes. The script should behave better as a cron job now.
A new option -q or --quiet suppresses output to stdout/console, yet retains log entires.
Considering that many users are still on ancient DD-WRT versions with outdated and/or
expired cURL certificates and exotic configuration that often doesn't play well with
this script, it now uses insecure cURL downloads (-k) as default mode of operation.
For experienced users, the new --secure command line parameter restores the secure
TLS/SSL communication with servers. After thinking long and hard and working with
users on solving their problems, offering sane defaults with switches to enable
advanced functionality seems like a good tradeoff. For now.