What's new

Any adblock scripts for 56U Padavan firmware?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

fsatsil

Regular Contributor
Does anyone know of an Adblock script that will work on the RT-N56U with Padavan's firmware? I found one for the Asuswrt-merlin firmware but havent had any luck finding one that will work on the RT-N56U.
 
I wish I could help you but wanted you to know that this is the better site to get a quicker response.....
Asus forum is so dead with new posts and responces, that the bones turn into fossils, haha....jk
Hopefully Merlin or GUZ will chime in....
They seem to be the ones that respond/know the most about these routers....
Hang in there and someone might help you resolve your problem....
They have helped me!
Good Luck!
Zainday
 
I'm beginning to think that maybe it's just not possible to do on the Padavan firmware otherwise I think someone would have done it by now. Maybe I'll just have to upgrade to a router that supports Merlin's software. Ad free web browsing in my iOS devices would be great!
 
Hmmmm... never thought about doing the blocking at the router. I just use AdBlock+ in Firefox, or turn on "Tracking Protection" in IE 11 (uses the same lists as AdBlock+)

Now before I get flamed... I'm actually starting to like IE again. M$ has been stepping up lately with it and getting it to be competitive with other browsers.

The biggest problem I've been finding with using ad blocking is lately, you can't get around some streaming video sites now. They either notice that you are running AdBlock+ and tell you turn it off, or if they can't serve the video ad, you can't get the desired video. Bastards :mad:
 
i use Firefox with Adblock+ on my PCs and it works great but in the last few years I find myself doing the majority of my web browsing on my Ipad and since Apple wont allow us to do adblocking in Safari i think adblocking on the router would be a great alternative. People seem to be doing it on other firmwares like Merlin's, DDWrt, Tomato...etc so I figured maybe someone could come up with a script for the Padavan firmware.
 
Oops, didn't notice this thread and posted in the other one since it came up first in Google when I was trying to figure the process out:

http://www.smallnetbuilder.com/forums/showpost.php?p=111194&postcount=17
Using this current thread and this issue thread you should be able to figure it out if you're handy with the command line.

- DNSMasq reads from /etc/hosts
- You can keep the mvps.org hosts in /etc/storage/dnsmasq/hosts (This is where the webGUI hosts editor saves to - tricky part is that it can't save the size of the mvps file across reboot and truncates it, so you need to either deal with that, or I'm just lazy and set it to run wget on every boot of the router)
- Startup script to copy hosts and cycle DNSmasq goes in /etc/storage/started_script.sh (Might also work in some other place, scripts here go in some order, but started_script works for me.)

So basically, all I've done is stick the following lines under Administration > Tweaks > Customer Router Tweaks > Run After Router started:

Code:
wget http://winhelp2002.mvps.org/hosts.txt -O /etc/storage/dnsmasq/hosts
cat /etc/storage/dnsmasq/hosts >> /etc/hosts
killall dnsmasq
dnsmasq

Saving the startup script through the webGUI seemed kind of finnicky, if it won't stick you may need to telnet/ssh in, edit the file manually and run "mtd_storage.sh save" yourself.

No cronjob for scheduled update, but I'm fine with the hosts file updating only on reboots (and on every reboot).

Remember to flushdns to test on PCs after applying to router.
 
its working perfectly the only problem is that the mvps host file is blocking some stuff I dont want blocked so ill have to make my own host file and put it up on dropbox or something.
 
I installed the latest Padavan Base firmware on my N56U and got this script loaded and ran it. I see in log that it says "read /etc/hosts - 13655 addresses" so it seemed it should be working, but I'm still seeing ads displayed. Do I need a flash drive for this? Any other thing installed except for flashing the firmware? Thanks for any help.
 
Shouldn't need a flash drive or anything else, and that looks like roughly the correct number of addresses.

Have you flushed the dns cache on your PC(s)? (ipconfig /flushdns at the Windows command prompt.)

Some ads won't be blocked (ads hosted on the same server as the website, text-based ads, etc.) - easiest way to see if the hosts file is working on a system is to just punch in any address from the hosts file to a browser, and you should get a "server not found" message.
 
Last edited:
I'm having trouble getting this command to work on firmware 081. I've copy/pasted the command to the Router Started custom script area, and it seems to stick when looking through SSH too. Looking back on the logs, the host file only has whatever I have defined previously to name the devices on my network. Running the command in terminal works fine. I'm confused. Any possible hints?
 
Figured it out by adding a sleep line at the start. I would hazard a guess at the script outpacing the WAN, and not being able to get the block list.

Code:
sleep 8
wget http://winhelp2002.mvps.org/hosts.txt -O /etc/storage/dnsmasq/hosts
cat /etc/storage/dnsmasq/hosts >> /etc/hosts
killall dnsmasq
dnsmasq
 
I found the previous script maxed out the JFFS partition, and made it impossible to make any changes to the settings.

I managed to get an Adblock-based script going using this guide. It can be followed until you're asked to add iptables rules, as the firewall-start scripts are in a different spot.

Instead, add the following line in the GUI under Administration -> Tweaks -> Firewall Start script, substituting the static IP addresses. It looks like this is going to be in a different spot in -084 when it comes out (under Customizations).

Code:
iptables -t nat -A PREROUTING --source [the static IP address you provided] -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

Everything else seems to be the same. I would imagine you'd want a cron job or something to update the list every so often.
 
Sorry for resurrecting an old thread but I thought this might be useful if other people stumble here in the future.

I got around the problem of maxing out the JFFS partition with a symbolic link:

Code:
killall dnsmasq
mkdir /var/startup/
cp /etc/storage/dnsmasq/hosts /var/startup/hostsOriginal
wget http://someonewhocares.org/hosts/hosts -O /var/startup/winHelpHosts
cat /var/startup/hostsOriginal >> /var/startup/winHelpHosts
cat /var/startup/winHelpHosts >> /etc/hosts
rm /etc/storage/dnsmasq/hosts
ln -s /etc/hosts /etc/storage/dnsmasq/hosts
rm -r /var/startup/
dnsmasq
 
If you only want to block add services, I found this service to work, had to add some quotation marks though:

Code:
killall dnsmasq
mkdir /var/startup/
cp /etc/storage/dnsmasq/hosts /var/startup/hostsOriginal
wget "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts;showintro=0;mimetype=plaintext" -O /var/startup/winHelpHosts
cat /var/startup/hostsOriginal >> /var/startup/winHelpHosts
cat /var/startup/winHelpHosts >> /etc/hosts
rm /etc/storage/dnsmasq/hosts
ln -s /etc/hosts /etc/storage/dnsmasq/hosts
rm -r /var/startup/
dnsmasq
 
Actually, I went a bit further. I found this project on Github: https://github.com/StevenBlack/hosts which uses a python script to aggregate lists of known add services and malware sites (also retrieves updated lists when run) and bakes them all into a hosts file. I set it up to run on my local server every Monday at 10 and copies the file to a virtualhost directory so that I can retrieve it from my router when it restarts. I also removed the someonewhocares site-provider from the list, since I think he (or she) really shouldn't care if I want to visit lemonparty or other sites that didn't stand up to his (or her) sense of decency.
So my code now instead wget's from my internal website instead.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top