Posted: Wed Jun 19, 2019 20:34 Post subject: Using Ad Blocking with OpenVPN client
Hello All,
I am attempting to add Ad blocking to my dd-wrt router. I currently have it configured to connect to my VPN provider using the OpenVPN client.
I see where some options need to be turned on that I have off for my OpenVPN configuration and I think enabling the DNS or DNSMasq (which is required for this?) may break the OpenVPN client. I saw another post where it appears you need to setup another DNS service to handle this in order to not break the OpenVPN?
Could someone please explain how this needs to be configured to work in conjunction with the OpenVPN client please. Thank you in advance for any help.
I'm unable to update or install Steam Games after installing this script.
I've added both steamcontent.com and steampowered.com, but it still doesn't work.
I've connected my computer directly to my modem and it works just fine.
Is there a possibility that this hostfile is blocking Steam? because when plugged into the router i have to connect multiple times to get my account to login.
Thank you for your awesome script, it works flawlessly!
If dd-wrt team could integrate it directly on dd-wrt, it could be awesome
One thing, I would like to cron the update with the -s2 parameter, but when I set it the update failed.
How can I do that?
Should I use quotes to integrate the parameter in cron line?
does actually this method block youtube ads like ublock origin addon does ??
None of the blockers running on routers (this ad-blocking script, Diversion on Asus-Merlin, Pi-Hole etc.) can block YouTube ads since both the video and the ad are served from the same domain and those scripts can't recognize which is which. You need to keep using a browser extension to be able to block YouTube video ads.
I was trying to install this script on my WDR4300, and finally got it working, but it seems script is not finding any hosts/domains.
Code:
======================================================
| adbhostgen for DD-WRT |
| https://github.com/m-parashar/adbhostgen |
| Copyright 2020 Manish Parashar |
======================================================
Wed Jan 29 16:07:18 UTC 2020
# VERSION: 20200110
# NETWORK: UP | MODE: ONLINE
# IP ADDRESS FOR ADS: 0.1.2.3
# SECURE [0=NO | 1=YES]: 0
# BLITZ LEVEL [0|1|2|3]: 1
# Creating mpdomains file
# Creating mphosts file
> Processing StevenBlack lists
> Processing notracking blocklists
> Processing Disconnect.me lists
> Processing quidsup/notrack lists
> Processing MalwareDomains lists
> Processing adaway list
# Unlocking BLITZ=1 level lists
> Processing more StevenBlack lists
> Processing hosts-file ATS/EXP/GRM lists
> Processing hosts-file HJK/PUP lists
> Processing dshield lists
> Processing pgl.yoyo.org list
> Processing Securemecca list
> Processing cryptomining and porn lists
> Processing Easylist & w3kbl lists
> Updating official blacklist/whitelist files
# Size of /tmp/mphosts.tmp: 116.0K
# Size of /tmp/mpdomains.tmp: 16.0K
> Processing blacklist/whitelist files
> Processing final mphosts/mpdomains files
> Removing temporary files
[b]# Size of /jffs/dnsmasq/mphosts: 0
# Size of /jffs/dnsmasq/mpdomains: 0[/b]
# Number of ad hosts blocked: approx 0
# Number of ad domains blocked: approx 0
> Restarting DNS server (dnsmasq)
# Total time: 1:9 minutes
# DONE
As You can see I'm getting 0 hosts/domains, I was trying to change BLITZ level but still the same, also trying to add my local Easylist.
I've checked tmporary files, and hosts/domains contains only '-' symbols.
Looks like there is problem with parsing lists when those are parsed using scipt.
I was trying to execute manually for example
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Wed Jan 29, 2020 17:08 Post subject:
never seen that script and i doubt it will execute...
also curl is not present on all routers and need to be installed via opt...
last thing if you D/L all those lines, from all those sources, you have to sed/sort them and erase the duplicates, otherwise you will be out of ram...
there are good ad-blocking scripts, that are confirmed as working and used from DDWRT community, just look around... _________________ 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
Thank you for your awesome script, it works flawlessly!
If dd-wrt team could integrate it directly on dd-wrt, it could be awesome :)
One thing, I would like to cron the update with the -s2 parameter, but when I set it the update failed.
How can I do that?
Should I use quotes to integrate the parameter in cron line?
Many thanks in advance!
Code:
0 6 * * 4 root /jffs/dnsmasq/adblock.sh -s2
Works perfectly fine on my test routers. Update to the latest version (read below) and check the log file for command line parameters, as well as errors. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
never seen that script and i doubt it will execute...
Your doubts are irrelevant as this script has been executing on my routers successfully for the past 3+ years. I appreciate constructive criticism with merit and inputs after a proper code review. I hope you will find time for this.
Alozaros wrote:
also curl is not present on all routers and need to be installed via opt...
Yes, and the script checks for curl before executing. Adding wget support has been on my todo list for a while.
Alozaros wrote:
last thing if you D/L all those lines, from all those sources, you have to sed/sort them and erase the duplicates, otherwise you will be out of ram...
The script does all of the above. And more.
Alozaros wrote:
there are good ad-blocking scripts, that are confirmed as working and used from DDWRT community, just look around...
This is confirmed as working and there weren't any half decent scripts when I started writing one for myself. There still aren't with even 10% of the features this supports. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
Could be any number of reasons. If you are trying to add/replace lists, you have to ensure that those are being parsed appropriately. You will notice that not all lists are parsed the same way by the script because they are structured differently.
I recommend that you install a new version of this script (still a work-in-progress but stable and tested) and check errors.
Yes, you will have to change the script name in your router web admin too, if you have or want to set up cron.
Then execute it with --debug command line argument and see if there are any errors. Errors should be in log.adblock.errors file.
This new version also supports remote operations. If your router is not powerful enough to process these huge lists, set up the script on a Linux system, generate blocklists locally and automatically upload to your router via SSH. Tested on Raspbian/Raspberry Pi 4 and Ubuntu/ThinkPad X1 systems.
Code:
./adblock --remote=192.168.1.1
This example generates lists with defaults and uploads the blocklists to your router (192.168.1.1) if SSH is enabled. Note that this mode is interactive unless you set up ssh with keys for automatic authentication.
I will update the original post with fresh instructions and description of options in a day or two.
Joined: 16 Nov 2015 Posts: 6447 Location: UK, London, just across the river..
Posted: Thu Jan 30, 2020 14:26 Post subject:
sry Yamaraj, totaly miss looked the thread,
yep your script is working as it should,
I tried it in the past on my R7000 but it was quite aggressive,
nowadays as a script im using something short and useful,
otherwise have a look here, our forum member SurprisedItWorks
successfully compiled this script that is
decent too, im using something similar to it, but very very short
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321121&start=60 _________________ 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
sry Yamaraj, totaly miss looked the thread,
yep your script is working as it should,
I tried it in the past on my R7000 but it was quite aggressive,
nowadays as a script im using something short and useful,
otherwise have a look here, our forum member SurprisedItWorks
successfully compiled this script that is
decent too, im using something similar to it, but very very short ;)
No worries, Alozaros. Yes, it is fairly aggressive but only as much as the lists themselves since this script, not unlike others, uses lists curated by third parties. This is what prompted me to add custom black/white-lists which have precedence over the defaults and can unblock a domain blocked by overly aggressive lists. Such aggressors have also been moved to level-3 and -4; the defaults are pretty sane. Now with remote operations enabled the script can be executed from a more powerful system, making it easier to manage on less powerful routers too.
I'll grant that those short scripts are indeed useful to a degree, albeit lacking certain features I require on my routers. Despite all the features, it is still under 700 lines of POSIX shell code with comments and all. Not as bloated as most software these days. Still, I welcome any and all improvements - code quality, performance, methodology.
Thank you for giving it a try. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)