Ad blocking

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> X86 based Hardware
Author Message
Cratebv212
DD-WRT Novice


Joined: 14 Dec 2016
Posts: 45

PostPosted: Sat Sep 12, 2020 18:25    Post subject: Ad blocking Reply with quote
I'm using the 64 2gb full version on a dell vostro. I've tried every script for ad blocking and none of them will work. I did use one on an archer c7 that worked great. I'm also using openvpn with policy based routing, but that worked with ad blocking on the c7. I'm using build 43886. Also the local dns option is not available.
Sponsor
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8343

PostPosted: Sat Sep 12, 2020 23:51    Post subject: Reply with quote
https://pastebin.com/aySi7RhY
_________________
DD-WRT: DNS Leak Detection w/ VPNs (updated 6/5/19)
ddwrt-ovpn-split-basic.sh (UPDATED!)
ddwrt-ovpn-split-advanced.sh (UPDATED!)
ddwrt-blacklist-domains.sh (UPDATED!)
ddwrt-ovpn-client-backup.sh
ddwrt-mount-usb-drives.sh
ddwrt-ovpn-remote-access.sh
ddwrt-pptp-policy-based-routing.sh
Cratebv212
DD-WRT Novice


Joined: 14 Dec 2016
Posts: 45

PostPosted: Sun Sep 13, 2020 22:10    Post subject: Reply with quote
I applied that to the startup script. Doesn't seem to be working.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8343

PostPosted: Sun Sep 13, 2020 23:15    Post subject: Reply with quote
Did you follow step #4 as well? Some ppl overlook that step and it won't work unless you do.

Also, if you uncomment the debug line, it will write to the syslog (assuming you have the syslog enabled) showing that it did run (or if it perhaps produced any errors).

_________________
DD-WRT: DNS Leak Detection w/ VPNs (updated 6/5/19)
ddwrt-ovpn-split-basic.sh (UPDATED!)
ddwrt-ovpn-split-advanced.sh (UPDATED!)
ddwrt-blacklist-domains.sh (UPDATED!)
ddwrt-ovpn-client-backup.sh
ddwrt-mount-usb-drives.sh
ddwrt-ovpn-remote-access.sh
ddwrt-pptp-policy-based-routing.sh
Cratebv212
DD-WRT Novice


Joined: 14 Dec 2016
Posts: 45

PostPosted: Sun Sep 13, 2020 23:30    Post subject: Reply with quote
I don't have jffs2 to enable either, perhaps thats my problem
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8343

PostPosted: Mon Sep 14, 2020 0:16    Post subject: Reply with quote
All my scripts assume the availability of jffs. It just simplifies installation. But in most cases, you can just save it to the startup script (Administration->Commands). But sometimes the script, as is, is too large, and you may have to delete the comments. You'll have to modify the cronjob as well.

Code:
4 * * * root /tmp/.rc_startup


The other options is to save the script to the custom script, then call the custom script from the startup script.

Code:
/tmp/custom.sh


And once again, adjust the cronjob.

Code:
4 * * * root /tmp/custom.sh

_________________
DD-WRT: DNS Leak Detection w/ VPNs (updated 6/5/19)
ddwrt-ovpn-split-basic.sh (UPDATED!)
ddwrt-ovpn-split-advanced.sh (UPDATED!)
ddwrt-blacklist-domains.sh (UPDATED!)
ddwrt-ovpn-client-backup.sh
ddwrt-mount-usb-drives.sh
ddwrt-ovpn-remote-access.sh
ddwrt-pptp-policy-based-routing.sh
Cratebv212
DD-WRT Novice


Joined: 14 Dec 2016
Posts: 45

PostPosted: Tue Sep 15, 2020 0:49    Post subject: Reply with quote
I'm getting this error

Apr 17 08:58:13 ******** daemon.err dnsmasq[2836]: failed to load names from /tmp/blacklisted_domains: No such file or directory
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8343

PostPosted: Tue Sep 15, 2020 1:18    Post subject: Reply with quote
Sounds like the script isn't even running, or is but producing some error. Because the file referenced by DNSMasq is created by my script.

Now you see why I have an installer. All it takes is a slight mistake in the setup, and things go wrong.

All I can recommend is making sure the DEBUG line at the top of the script is enabled, making sure the syslog is enabled, rebooting, and checking the syslog for any messages from the script (w/ the DEBUG option enabled, there should be plenty of such messages).

From a shell (ssh/telnet)...

Code:
cat /var/log/messages | grep 'rc_startup'


or

Code:
cat /var/log/messages | grep 'custom'


... depending on whether you used the startup or custom script to run my script.

If you don't see anything at all, the error is so severe it never got started.

_________________
DD-WRT: DNS Leak Detection w/ VPNs (updated 6/5/19)
ddwrt-ovpn-split-basic.sh (UPDATED!)
ddwrt-ovpn-split-advanced.sh (UPDATED!)
ddwrt-blacklist-domains.sh (UPDATED!)
ddwrt-ovpn-client-backup.sh
ddwrt-mount-usb-drives.sh
ddwrt-ovpn-remote-access.sh
ddwrt-pptp-policy-based-routing.sh
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 8343

PostPosted: Tue Sep 15, 2020 2:00    Post subject: Reply with quote
As a sanity check, I decided to install the script as described in the documentation to jffs. I'm even using a dd-wrt x86 build. It works fine. So the script itself is fine.

However, I noticed an issue if I saved it to the custom script. Apparently something changed in dd-wrt, and the custom script is no longer saved to /tmp/custom.sh (as it says in the dd-wrt wiki, https://wiki.dd-wrt.com/wiki/index.php/Startup_Scripts#Custom_Scripts), but instead /tmp/.rc_custom! So if you're using the custom script method, the startup script needs to have the following.

Code:
/tmp/.rc_custom


And if I now grep for the custom script …

Code:
cat /var/log/messages | grep 'custom'


… I see the output. One of the last lines says 'total blacklisted domains: 18662'.

Why and when this was changed, I don't know. But I rarely ever use the custom script, and last time I did, it was /tmp/custom.sh. Somewhere along the dd-wrt timeline this changed.

P.S. If you copy/paste from PasteBin, make sure you copy from the RAW Paste Data section.

Another common error is to download to Notepad, make changes, then upload to the router, which leaves DOS CR/LFs in the output, which Linux can't read.

Again, that's the reason for the installer. To avoid all kinds of common errors.

_________________
DD-WRT: DNS Leak Detection w/ VPNs (updated 6/5/19)
ddwrt-ovpn-split-basic.sh (UPDATED!)
ddwrt-ovpn-split-advanced.sh (UPDATED!)
ddwrt-blacklist-domains.sh (UPDATED!)
ddwrt-ovpn-client-backup.sh
ddwrt-mount-usb-drives.sh
ddwrt-ovpn-remote-access.sh
ddwrt-pptp-policy-based-routing.sh
Cratebv212
DD-WRT Novice


Joined: 14 Dec 2016
Posts: 45

PostPosted: Tue Sep 15, 2020 2:07    Post subject: Reply with quote
Through ssh I see no errors and since reboot the syslog has no errors. I also used wget instead of curl if that makes a difference. Seems to be working now, thank you very much for the help.
Cratebv212
DD-WRT Novice


Joined: 14 Dec 2016
Posts: 45

PostPosted: Tue Sep 15, 2020 3:00    Post subject: Reply with quote
I redid everything through my phone and an app called termius and now it works. I don't know what the difference is but I won't wonder.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> X86 based Hardware 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 cannot attach files in this forum
You cannot download files in this forum