I have the startup script added, added the additional dnsmasq options and the local dns option enabled but when I go to one of the URLs in these host files the website still comes up.
Also, it looks like on my Netgear R7800 it only loads one of the two files on startup. I have to manually fetch the other. This is in my startup as was posted earlier:
2nd and 3rd line go together in the same line, should be a space not an enter. _________________ R6400v2 (boardID:30) - Kong 36480 running since 03/09/18 - (AP - DNSMasq - AdBlocking - QoS) R7800 - BS 31924 running since 05/26/17 - (AP - OpenVPN Client - DNSMasq - AdBlocking - QoS) R7000 - BS 30771 running since 12/16/16 - (AP - NAS - FTP - SMB - OpenVPN Server - Transmission - DDNS - DNSMasq - AdBlocking - QoS) R6250 - BS 29193 running since 03/20/16 - (AP - NAS - FTP - SMB - DNSMasq - AdBlocking)
Posted: Mon Jan 14, 2019 12:15 Post subject: thanks for the response! another inquiry...
Xeon2k8 wrote:
Alozaros wrote:
....
P.S hmmm Xeon2k8 it seems the script you posted works but not blocking most of the adverts like http://www.mvps.org/winhelp2002/hosts.txt do especially on those sites im used to ...
It's included already, along with a lot more other hosts file sources.
Yeah I have also the cron job setup, but no additional dnsmasq configs. I agree on the jffs subject, prefer using just tmp folder.
Also what I did was detach it from startup since I don't want startup script executing all the time on cron. That way I can add all things I want in startup without having to remember that it's also being run on the cron on a daily basis. Like this:
Startup script:
{for loop from tatsuya86 for governors}
/tmp/custom.sh
Cron job:
0 12 * * * root /tmp/custom.sh
And the adblock script is saved in custom script.
Thanks for the response Xeon2k8! On this comment, do I add the "/tmp/custom.sh" on the startup script as well?
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Mon Jan 14, 2019 12:19 Post subject:
hmm im not sure this script is working on all routers
make sure you have curl command working
make sure this script has the correct syntax
im not a script guy but as it seems it doesn't get executed in this format so there must be something either with spacing or syntax or curl command....
there are some other scripts with http sources and wget that work ok... _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Mon Jan 14, 2019 12:23 Post subject:
mondc10 wrote:
Startup script:
{for loop from tatsuya86 for governors}
/tmp/custom.sh
Cron job:
0 12 * * * root /tmp/custom.sh
And the adblock script is saved in custom script.
Thanks for the response Xeon2k8! On this comment, do I add the "/tmp/custom.sh" on the start-up script as well?
you can just add the script in start-up but than it will be executing all you have in start-up according to timing set in cron...
other way proposed is just executing the custom script bit instead... you decide _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Posted: Mon Jan 14, 2019 13:57 Post subject: may I know which one works for you?
Alozaros wrote:
mondc10 wrote:
Startup script:
{for loop from tatsuya86 for governors}
/tmp/custom.sh
Cron job:
0 12 * * * root /tmp/custom.sh
And the adblock script is saved in custom script.
Thanks for the response Xeon2k8! On this comment, do I add the "/tmp/custom.sh" on the start-up script as well?
you can just add the script in start-up but than it will be executing all you have in start-up according to timing set in cron...
other way proposed is just executing the custom script bit instead... you decide
Hi Alozaros, appreciate you chiming in. I tried this but seems there is something wrong and it's not working. I have Archer c9 v3 if that helps. Can you kindly point me to which others I can try? I tried the OP's script, then this one but none works.. T_T How do I know curl is running on my router?
As Alozaros said you better check if it runs correctly for you.
About the custom script, i saved this script in "save custom script" because I have things in startup script that I don't want them to be executed every single time on the cron schedule. So it's up to you on which script you want to save it.
I modified that first version several times, if that one doesn't work you may want to give this one a shot :
Code:
#!/bin/sh
# Dont forget to enable DNSMasq, local DNS,
# and add this to cron jobs 0 12 * * 1 root /tmp/custom.sh
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Mon Jan 14, 2019 16:12 Post subject:
well fairly this script is not working for my 1043nd v2
it says connecting to...
Updating adblocker FAILED!
witch lead me to the clue either curl is not working or something else, i just cant find where it dl the stuff
thanks a lot guys for helping me out, I will check again and will update once I have performed the steps, apologies for the late response, it was 12am my time. Thanks again!
thanks a lot guys for helping me out, I will check again and will update once I have performed the steps, apologies for the late response, it was 12am my time. Thanks again!
Sooo I tried both scripts from Alozaros and Xeon2k8 which btw was very helpful, (tremendous respect to both of you) and I can see on the logs that there were dropped connections like this:
Jan 15 15:28:40 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:05:dc SRC=176.9.107.237 DST=112.211.250.189 LEN=1500 TOS=0x00 PREC=0x00 TTL=109 ID=26218 DF PROTO=TCP SPT=80 DPT=48896 SEQ=3492722989 ACK=3972566913 WINDOW=2
Jan 15 15:28:40 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:30 SRC=185.10.57.187 DST=112.211.250.189 LEN=48 TOS=0x00 PREC=0x00 TTL=120 ID=44905 PROTO=TCP SPT=53021 DPT=25 SEQ=2095307676 ACK=1287352588 WINDOW=65535
Jan 15 15:28:45 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:05:dc SRC=176.9.107.237 DST=112.211.250.189 LEN=1500 TOS=0x00 PREC=0x00 TTL=109 ID=26295 DF PROTO=TCP SPT=80 DPT=48896 SEQ=3492722989 ACK=3972566913 WINDOW=2
Jan 15 15:28:50 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:28 SRC=82.202.219.203 DST=112.211.250.189 LEN=40 TOS=0x00 PREC=0x00 TTL=242 ID=38124 PROTO=TCP SPT=60000 DPT=3395 SEQ=2814337810 ACK=0 WINDOW=1024 RES=0x0
Jan 15 15:28:55 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:05:dc SRC=176.9.107.237 DST=112.211.250.189 LEN=1500 TOS=0x00 PREC=0x00 TTL=109 ID=26930 DF PROTO=TCP SPT=80 DPT=48896 SEQ=3492722989 ACK=3972566913 WINDOW=2
Jan 15 15:29:14 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:28 SRC=176.9.107.237 DST=112.211.250.189 LEN=40 TOS=0x00 PREC=0x00 TTL=109 ID=27914 DF PROTO=TCP SPT=80 DPT=48896 SEQ=3492724437 ACK=3972566913 WINDOW=0 R
Jan 15 15:29:57 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:34 SRC=24.104.74.26 DST=112.211.250.189 LEN=52 TOS=0x00 PREC=0x00 TTL=118 ID=894 DF PROTO=TCP SPT=50478 DPT=445 SEQ=251545384 ACK=0 WINDOW=8192 RES=0x00 S
Jan 15 15:29:58 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:28 SRC=185.222.210.92 DST=112.211.250.189 LEN=40 TOS=0x00 PREC=0x00 TTL=240 ID=23586 PROTO=TCP SPT=8080 DPT=9595 SEQ=136348644 ACK=0 WINDOW=1024 RES=0x00
Jan 15 15:30:19 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:28 SRC=92.53.64.28 DST=112.211.250.189 LEN=40 TOS=0x00 PREC=0x00 TTL=242 ID=6647 PROTO=TCP SPT=60000 DPT=23389 SEQ=3617437719 ACK=0 WINDOW=1024 RES=0x00 S
Jan 15 15:30:21 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:2c SRC=71.6.167.142 DST=112.211.250.189 LEN=44 TOS=0x00 PREC=0x00 TTL=120 ID=16276 PROTO=TCP SPT=18242 DPT=4022 SEQ=1890751592 ACK=0 WINDOW=46659 RES=0x00
Jan 15 15:33:03 Nighthawk X8 kern.warn kernel: DROP IN=vlan2 OUT= MAC=ac:84:c6:30:15:fd:ac:85:3d:95:3c:67:08:00:45:00:00:28 SRC=185.222.210.45 DST=112.211.250.189 LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=9172 PROTO=TCP SPT=54379 DPT=58196 SEQ=3708041789 ACK=0 WINDOW=1024 RES=0x0
Don't mind the name Nighthawk, just want to confuse my neighbors hehe, I have Archer C9
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Tue Jan 15, 2019 16:01 Post subject:
well there is no ultimate ad blocker as ad-blocking is host file based not every hosts are present in the block file... i guess curl based ad blocking script has more hosts to block than the other one as it combines few host lists...
for more serious blocking for Broadcom routers you might look here
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=307533 _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913