How can I block a specific URL on a DD-WRT router?

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
davidkennedy85
DD-WRT Novice


Joined: 10 Sep 2012
Posts: 18

PostPosted: Mon Sep 10, 2012 4:20    Post subject: How can I block a specific URL on a DD-WRT router? Reply with quote
For example, I want to block website.com/whatever but not website.com, blah.website.com, or website.com/blah. Is there a way to do this, or can you only block the whole domain?

I tried adding the URL in question under Access Restrictions in the DD-WRT configuration but it doesn't seem to have any effect. Here are my settings:



and here is the list of clients:



I can still easily browse to google.com/imghp and google.com/images (which redirects to google.com/imghp) on my main PC with IP address 192.168.1.146.

Can I do this under Access Restrictions, or do I need to use iptables or set up a proxy server or something?


Last edited by davidkennedy85 on Mon Sep 17, 2012 16:44; edited 1 time in total
Sponsor
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Mon Sep 10, 2012 16:20    Post subject: Reply with quote
i dont think iptables will allow what u need. afaik u have to setup a proxy
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
davidkennedy85
DD-WRT Novice


Joined: 10 Sep 2012
Posts: 18

PostPosted: Mon Sep 10, 2012 18:17    Post subject: Reply with quote
Thanks for the info Sash. Do you or anyone else know of like a public proxy I could use or do I have to have my own server constantly running a proxy?
goli
DD-WRT Novice


Joined: 01 Sep 2012
Posts: 12

PostPosted: Tue Sep 11, 2012 22:09    Post subject: Reply with quote
Hey there.

There's a privoxy version that runs on dd-wrt quite well. I just installed it.

Privoxy has a parameter "accept-intercepted-requests 1" that allows to use it as a transparent proxy.

I added a single iptables rule that passes some web traffic requests to the proxy instead of directly routing it.
Code:
iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -s 192.168.0.128/255.255.255.224 -j DNAT --to 192.168.0.1:8118


Privoxy has so called "actionfiles". Those define what to do when a request URL matches a given regular expression. One of the possible actions is "block".

That's it.

Regards,
Stephan.
davidkennedy85
DD-WRT Novice


Joined: 10 Sep 2012
Posts: 18

PostPosted: Wed Sep 12, 2012 4:06    Post subject: Reply with quote
Thank you, goli. That is exactly what I was looking for! Now I just have to figure out how to install new services in DD-WRT.
mlipok
DD-WRT Novice


Joined: 23 Jan 2013
Posts: 1

PostPosted: Wed Jan 23, 2013 18:28    Post subject: is there any way to do that by access restriction ? Reply with quote
because its still do not work
ElToro
DD-WRT Novice


Joined: 20 Dec 2012
Posts: 4

PostPosted: Sun Feb 10, 2013 19:27    Post subject: Reply with quote
It should be possible with dnsmasq if properly configured, but, so far, I've been unable to do it with dd-wrt. See my post here: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=730290#730290

to which there has been no response at all Sad
Le Dam
DD-WRT Novice


Joined: 28 Sep 2012
Posts: 26

PostPosted: Fri May 10, 2013 13:51    Post subject: Reply with quote
Hi,
I've tried many firmwares, but the problem still there:
ftp://dd-wrt.com/others/eko/BrainSlayer-V24-preSP2/

(my router : WRT54GL v1.1)

Impossible to block URL or words...
I've tried with a WRT54G v3.1 and it work.

Why ?
Thanks Wink
Le Dam
DD-WRT Novice


Joined: 28 Sep 2012
Posts: 26

PostPosted: Fri May 10, 2013 15:08    Post subject: Reply with quote
Thank you eibr-grad for your quick answer.
I'm not a specialist and I don't understand the parallel proxy server.
And I want this router work alone (without PC) for the proxy server.

I just tried many firmwares and I don't understand why it work on WRT54G v3.1 and not with WRT54GL v1.1

Now, my WRT54g v3.1 is in another house and I can't check it for look the firmware version... Sad

(and sorry for my bad english, I usually speak french)
campigenus
DD-WRT Guru


Joined: 01 Apr 2007
Posts: 520

PostPosted: Fri May 10, 2013 15:43    Post subject: Reply with quote
Might not be the answer you, the OP, is looking for, but blocking by keyword works well in TomatoUSB.
_________________
"You think you´re real smart. But you´re not smart; you´re dumb. Very dumb. But you´ve met your match in me. "
Colonel Flagg
Le Dam
DD-WRT Novice


Joined: 28 Sep 2012
Posts: 26

PostPosted: Fri May 10, 2013 15:50    Post subject: Reply with quote
Thanks campigenus, but is it possible to change the mode in repeater with this firmware ?

I don't know this TomatoUSB. Can you show me a link with the firmware for WRT54GL ?

Thanks a lot Wink
campigenus
DD-WRT Guru


Joined: 01 Apr 2007
Posts: 520

PostPosted: Fri May 10, 2013 16:12    Post subject: Reply with quote
Yes, you can use TomatoUSB as a repeater. It IS more complicated to set up though.

There are several versions of Tomato, I am currently a fan of the Shibby versions - http://tomato.groov.pl/ .

_________________
"You think you´re real smart. But you´re not smart; you´re dumb. Very dumb. But you´ve met your match in me. "
Colonel Flagg
Le Dam
DD-WRT Novice


Joined: 28 Sep 2012
Posts: 26

PostPosted: Fri May 10, 2013 22:16    Post subject: Reply with quote
Tank you campigenus.
I just find another temporary solution, but with another Linksys router. The winner is WRT54G v7.2.
This router, with r14929 (micro) accept all restrictions.

Now, I must find same solution for my 2 wrt54gl v1.1
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking 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