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.
How to install/upgrade:
SSH into router
cd /jffs/dnsmasq
curl -o adblock.sh adblock.sh (or wget -O adblock.sh adblock.sh)
chmod + adblock.ah
Then follow instructions in the original post to set up dnsmasq and cron.
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.
I keep getting permission denied whenever I use ./adbhostgen.sh
I did use chmod +x adbhostgen.sh before it
This is strange. Try chmod u+x or chmod 0755. If all else fails, you can do sh <scriptname>.
I also strongly recommend that you try the new version adblock.sh. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
Can you tell me if this list from easylist.to is
added to your adblock?
Or if i make a blacklist out of it will it work?
This script, like Pi-Hole and others, operates at domain level not on page elements and as such cannot use those lists. Although quite effective, it cannot block 100% of ads, especially those leveraging browser features like Javascript, frames etc. For that adding another layer of protection like uBlock Origin is recommended.
I recommend this script or Pi-Hole on your network anyway as not all devices have access to browser-level blocking. Besides, since this operates at network level, requests other than browsers are blocked as well. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
EDIT:
i updated adbhostgen.sh and after run it and it is working.
adblock.sh gives the error code (smth with logfile)
Oh, FFS! The firmware on your router doesn't come with this tiny useful binary. I will update adblock.sh soon with some other logging method. Until then, the old version should do the job. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
Oh, that was just an expression of frustration at the unavailability of this tiny binary in some versions of firmware. Certainly not directed at you. I am sorry for not making it clear enough.
Please report any other issues you encounter while using either versions. Thank you. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
Once again Thank you Yamaraj for sharing your work
I have been using your new script (adblock.sh) since its release without any real issues
on a R6300V2 running firmware DD-WRT v3.0-r39345M kongac (04-03-19) using the options -2sF
1 observation..
In a rather quick test...
The pause function does not appear to fully disable the script
I did clear browser cache & cookies, even rebooted pc
Nor is running the -p or -r options reflected in the script's log
1 complaint..
I would prefer the script's log to amended itself, like your last script (adbhostgen.sh) did.
Rather than overwriting the log every time the script runs? _________________ Location 1
R7800- DD-WRT v3.0-r53562 (10/03/23) Gateway
WNDR3400v1 DD-WRT v3.0-r35531_mega-nv64k (03/26/18 ) Access Point
WRT160Nv3 DD-WRT ?v3?.0-r35531 mini (03/26/18 ) Access Point
WRT54GSv5 DD-WRT v24-r33555_micro_generic (10/20/17) Repeater
Location 2
R7800- DD-WRT v3.0-r51855 (02/25/23) Gateway
R6300v2- DD-WRT v3.0-r50671 (10-26-22) Access Point
WNDR3700v2 DD-WRT v3.0-r35531 std (03/26/18 ) Access Point
E1200 v2 DD-WRT v3.0-r35531 mega-nv64k (03/26/18 ) Gateway(for trivial reasons)
RBWAPG-5HACT2HND-BE RouterOS-v6.46.4 (2/21/20) Outdoor Access Point
2x RBSXTG-5HPACD RouterOS-v6.46.4 (2/21/20) PTP Bridge 866.6Mbps-1GbpsLAN
Location 3
2x R7000- DD-WRT v3.0-r50671 (10/26/22) Access Points
2x RBWAPG-60AD RouterOS-v6.45.9 (04/30/20) PTP Bridge 2.3Gbps-1GbpsLAN
2x RBSXTsqG-5acD RouterOS-v6.49.7 (10/14/22) PTP Bridge 866.6Mbps-1GbpsLAN Thank You BrainSlayer for ALL that you do & have done, also to "most" everyone here that shares their knowledge
Followed the setup exactly, and the script runs everything perfectly. However, it appears dnsmasq is not launching with the config settings in "Additional Dnsmasq Options" on reboot. When I run ps | grep dnsmasq, it says it is running with the default tmp config:
dnsmasq: failed to create listening socket for port 53: Address in use
If I check with netstat, 53 is being used by "unbound".
Code:
# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 15060/unbound
If I kill this process id, and then start dnsmasq, it works. But I can't kill an unknown id upon boot every time and would have to manually do this in case of a reboot.
Any ideas on what's wrong with my setup?
edit: nevermind, I didn't realize "unbound" was the name of an actual program... thought that was akin to "unknown".
Using Netgear R6700, DD-WRT v3.0-r42287 std (02/06/20)[/b]
Once again Thank you Yamaraj for sharing your work
I have been using your new script (adblock.sh) since its release without any real issues
on a R6300V2 running firmware DD-WRT v3.0-r39345M kongac (04-03-19) using the options -2sF
1 observation..
In a rather quick test...
The pause function does not appear to fully disable the script
I did clear browser cache & cookies, even rebooted pc
Nor is running the -p or -r options reflected in the script's log
1 complaint..
I would prefer the script's log to amended itself, like your last script (adbhostgen.sh) did.
Rather than overwriting the log every time the script runs?
Thanks for feedback. I will make these necessary changes in the next update. _________________ Routers
NETGEAR R7800 x2: DD-WRT v3.0-r42847 std (04/06/20)
NETGEAR R8500: DD-WRT v3.0-r41517 std (11/11/19)
Posted: Tue Mar 03, 2020 0:34 Post subject: Wifi Oddities
I believe I have the adblock running correctly. Thank you to all who developed this!
Now that it is running, I am having odd Wifi responses and I didn't know if others may have run into them as well.
My wired computers and Rokus run just fine (better than fine; the ads are blocked!). My wireless Roku seems to do just fine as well.
Here's where it gets flaky. With data off, I can send/receive texts from my phone... which is odd because my phone's says that the wifi cannot get an IP address from my router. The texts should not pass. In fact all of the wireless devices (Apple, Samsung) think that they cannot get an IP address from either the 2.4G or 5G service.
Even more odd is that my router (WRT32XB) thinks that it has handed out IP addresses as I can see the wireless devices' MAC addresses in the connection table.
There's no functionality cross over between wifi connectivity and the DNS that I'm missing is there?
My router status says it's running < 1% load (temp = 75C) and has 58% free memory (not accounting for an additional 1G of swap space on a USB drive). So, I don't think it's struggling to keep up.
Update: If I set up each wireless device as a Static IP address, they connect to the router. I'm frustrated with this so I'm not seeing the obvious... Any thoughts?
Double Update: One of the Ipads additionally needed the DNS set up to go through the router before Safari would surf.
FINAL Update: I re-ran the adblock.sh script and it appears it was not completing correctly due to an issue with curl. After getting entware installed, then curl installed, I re-ran the script and can see that it runs more completely. The network appears to now work.