Block ads at your router – ADBlock and Tomato Firmware

Want to block ads on your computer regardless of the browser you use?  How about ads and phones?  Here’s one way if you have a Tomato firmware based router

Open up your router’s webpage -Go to Administration -Click on the tab WAN Up –

(Be prepared to visit the webpage at the bottom of this post – make sure the formatting of quotes and the script is correct before continuing.  Important – also be prepared to reset your router if this does not work.)

WanUp

Enter the following text –

## ALL-U-NEED Ad Blocking v3.9e
## http://goo.gl/mhykQ
## Original script by YAQUI
## Updated by ~nephelim~, Syl, jochen, groosh, ng12345, ray123, mstombs
## base64 decoder by Danny Chouinard’s

sleep 10

ADB=”/tmp/ADBLOCK.sh”
{
cat <<‘ENDF’ >$ADB
#!/bin/sh

OPTIMISE=”Y”
GETS=”1 2 3 4″
TRIM_BEGIN=3
S1=”http://pgl.yoyo.org/as/serverlist.php?hostformat=nohtml&#8221; #44K
S2=”http://mirror1.malwaredomains.com/files/justdomains&#8221; #189K
S3=”http://www.malwaredomainlist.com/hostslist/hosts.txt&#8221; #97K
S4=”http://winhelp2002.mvps.org/hosts.txt&#8221; #620K
S5=”http://hosts-file.net/hphosts-partial.asp&#8221; #460K
S6=”http://hostsfile.mine.nu/Hosts&#8221; #2641K
S7=”http://support.it-mate.co.uk/downloads/hosts.txt&#8221; #3851K

USEWHITELIST=”Y” # N/Y/R for remote
WURL=”http://example.com/whitelist.txt&#8221;
WHITE=”intel.com”
BLACK=””

USEPIXELSERV=”N”
PXL_IP=192.168.1.2
PXL_EXE=”/tmp/pixelserv”
PXL_URL=”http://example.com/pixelserv&#8221;

UPLOAD=”N”
FTP_SERVER=”example.com”
FTP_USER=””
FTP_PASS=””
FTP_PORT=21
FTP_PATH=”/gen”

ADD_CONF=”N”
USEHOSTS=”N”
ROUTER=”Y”

NIP=”0.0.0.0″

ENDF
}

UPDATE=”Y”
AUP() {
if [[ “$UPDATE” == “Y” ]] ; then
if [[ “$(cru l | grep AdUpd | cut -d ‘#’ -f2)” != “AdUpd” ]] ; then
cru a AdUpd “0 4 * * * $ADB”
fi
fi
}

#### DO NOT EDIT BELOW ####

b64=”openssl enc -base64 -d”
[[ “$(echo WQ==|$b64)” != “Y” ]] && b64=”b64″

b64(){
awk ‘BEGIN{b64=”ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/”}
{for(i=1;i<=length($0);i++){c=index(b64,substr($0,i,1));if(c–)
for(b=0;b<6;b++){o=o*2+int(c/32);c=(c*2)%64;if(++obc==8){if(o)
{printf”%c”,o}else{system(“echo -en \”\\””)}obc=o=0}}}}’;}

{
cat <<‘ENDF’| $b64 |gunzip >>$ADB
H4sIAJn5fk4CA61Xe2/aSBD/359iuvHFkKsx5Jq7KtSRCI+ASgCBc+kpJBG1F1gV
bGo7j17od7/ZWRsMJG2kXpMq693Zmd+8Zyv9s4Gt72ln9Y7NrHi+sCbcZ5pz3ks+
Yz5fMK3a7TSSDTfwx0xrdgfOINmZBlEcMe2y0WrXk62HqYg50/CfGMPVFegVlANv
bCjC9TUsl3KP6blFBEuYhHwBJgfDNCVvI90y/OBz4H0z8gxsGxjDm2WIp9zXwjmY
Y9ARc2HuHWU/Z6Mo1sZCCq62+7k8PGVO0yUqly6lXuma8Gvf5d3epzbdVeCZfjGo
91qf6u1Bvf+3QvNPBo6iegPmI+h487b+qb4+fJjwGMzu+oQWF/225k7ngQe/ry9J
4GIsbSAm8DksHhfVUau3ApJbCC8Yw0I88lnEw/sd22zJafXA9CWvMkQzjkYtQRnk
VYAvYjYDc9A6uxj0S7DLuQwE55VytVkwmfAQKrXTdrf6Eer9frd/DO7I94MYongU
xuvbmvyj8fvRDFin1bMTqEwaAH/JBZ0qeeCiU6s37KI2DkIQIHzpSGdQBi8AxeAu
nNlsqA90wUDrlWw9x91pADruLyHiHhjR8mYax4ur6Prg2LKubqzrg2HOKhwM8/py
WFoaea3582vDnLqYx4vpNYnpUWIqwSH8ITFpsZjzlBeGNGvWKzX0RAmajtOzSoXS
MBz6TcyXY9Cb9FENfJ+7sQh8tNYsiLjcZEv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fOSwKbY6GIPyVYNb0VIamcUEtWciAbeV7Io8i29i3FeGms
9FFlt9o4e50uQF3M4rFreX40H0VfC3Ikp8Sm54I8Tj/gw4d6t6GheN+kCLTXLyJN
nhDYlxlmIVZqtW2QuHUrxTwD8hV6qAEbedqElWXHbtpF6TRzrzRqnCUKeVN3YY7u
4mkQingUi3uphDvlZiT+5fZh8d17mS7mKPrmu/YRabqy9Gn7YzL3hPcC+2WiND4C
gsVrYKf06jlojsWMKwUU/mePs3Zs0CBEFlq/L43k2s7rElKx2+mfyhERhHe+j8X4
R20Eo0++cWTJTp2MRTtZrqDhmCDflvJ1g/OaHGhoHpBlSfYK+ktFRvtpBaHspLBO
AocMj8rT81cK0v4De76CG9wPAAA=
ENDF
}

chmod 775 $ADB
$ADB
AUP

Click on save after entering the code above.

WanUPSave

Reboot

Go to logs in your router.  You should see ADBlock loaded.   While this will not get rid of all of the ads, you will notice that most are gone.  Can’t get to a website?  Enter the website in the above code on the router to whitelist the site.  Save and Reboot.

Want to remove it?  Open your router’s webpage, delete the code and click save.

More information – http://www.linksysinfo.org/index.php?threads/all-u-need-ad-blocking.33191/#post-163489

IMPORTANT -Always backup your router.   Be prepared to reset your router if this does not work on your router.

Have DD-WRT?  http://www.dd-wrt.com/wiki/index.php/Ad_blocking

Advertisements

About TCAT Shelbyville IT Department

The Tennessee College of Applied Technology - is one of 46 institutions in the Tennessee Board of Regents System, the seventh largest system of higher education in the nation. This system comprises six universities, fourteen community colleges, and twenty-six Applied Technology Colleges.
This entry was posted in Technology and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s