Enforcing Google SafeSearch with dd-wrt

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Wed Oct 30, 2013 15:46    Post subject: Reply with quote
These commands would go in the firewall rules section ...

Go to Administration | Commands and enter (cut-n-paste) in the dialog box that you see.

Once entered, click the 'Save Firewall' button below.

If all goes well, your router should reboot to bring the rules into effect.

Let us know how this goes.

Thanks.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
Sponsor
warmweatherjoe
DD-WRT Novice


Joined: 25 Oct 2013
Posts: 11

PostPosted: Wed Oct 30, 2013 16:14    Post subject: Reply with quote
I did this first:
in Additional DNSMasq Options:
Code:
address=/google.com/216.239.32.20
address=/google.ca/216.239.32.20

and it worked for google.ca but not google.com. By worked I mean it forced me to no all search.

When I put in the firewall rules you suggested (into Administration | Commands) , the ones like this
iptables -I PREROUTING -d 193.105.163.208 -j DNAT --to-destination 216.239.32.20

it now forces me to all on both google.com and google.ca which is not what I want. How do I remove those rules? It look alike I have to overwrite them with new rules to cancel them out. Can you please tell me how I delete those rules?

Thanks.
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Wed Oct 30, 2013 16:42    Post subject: Reply with quote
2 ways to do this.

1. Go back into Admin|Command, under the listing of the firewall rules, you will see an 'edit' button, clicking that will bring the rules into the 'command' section. You can now edit these and hit the 'save firewall' to implement the changes.

2. Go to 'Admin | Command' and if the command window is blank, click the save Firewall at the bottom. This will 'clear' out all the firewall rules. Use this with caution, if you have firewall rules that you would like to retain.

Smile

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
warmweatherjoe
DD-WRT Novice


Joined: 25 Oct 2013
Posts: 11

PostPosted: Wed Oct 30, 2013 21:19    Post subject: Checking rule to undo Reply with quote
So to undo this rule
iptables -I PREROUTING -d 193.105.163.208 -j DNAT --to-destination 216.239.32.20

do I put in this?

iptables -I PREROUTING -d 193.105.163.208 -j DNAT --to-destination 193.105.163.208
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Wed Oct 30, 2013 21:46    Post subject: Reply with quote
Delete the rule and reboot the router.
_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
warmweatherjoe
DD-WRT Novice


Joined: 25 Oct 2013
Posts: 11

PostPosted: Wed Oct 30, 2013 22:02    Post subject: Reply with quote
I don't see how to delete the rule. I clicked the Edit button, all the rules appeared in the editable box, I deleted them and rebooted but they are still there. So that's why I thought I had to overwrite them or give a command to delete them, which I don't know how to do.

This is what I see right now
https://www.evernote.com/shard/s45/sh/fac7943d-2b28-4d5c-b4ba-1ce849c64962/1609827a0e58dd679f130d970fa3b38b
warmweatherjoe
DD-WRT Novice


Joined: 25 Oct 2013
Posts: 11

PostPosted: Wed Oct 30, 2013 22:03    Post subject: Reply with quote
OK I did this "2. Go to 'Admin | Command' and if the command window is blank, click the save Firewall at the bottom. This will 'clear' out all the firewall rules. Use this with caution, if you have firewall rules that you would like to retain. "

and it worked. Those rules are gone. Now I'll reboot and check again.
Thanks.
warmweatherjoe
DD-WRT Novice


Joined: 25 Oct 2013
Posts: 11

PostPosted: Wed Oct 30, 2013 22:08    Post subject: Reply with quote
At this point I have pasted this in Additional DNSMasq Options:
address=/google.com/216.239.32.20
address=/google.ca/216.239.32.20

and I am being forced to no ssl on google.ca but not on google.com
so I am almost there.

Any suggestions from anyone?
Is it possible to write it using a wildcard for the Top Level Domain? Like this:
address=/google.*/216.239.32.20
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Wed Oct 30, 2013 22:31    Post subject: Reply with quote
warmweatherjoe wrote:
I don't see how to delete the rule. I clicked the Edit button, all the rules appeared in the editable box, I deleted them and rebooted but they are still there. So that's why I thought I had to overwrite them or give a command to delete them, which I don't know how to do.

This is what I see right now
https://www.evernote.com/shard/s45/sh/fac7943d-2b28-4d5c-b4ba-1ce849c64962/1609827a0e58dd679f130d970fa3b38b


Looks like you missed the 'save firewall' step after deleting the entries from the edit box. Anyway looks like you are past this point.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
warmweatherjoe
DD-WRT Novice


Joined: 25 Oct 2013
Posts: 11

PostPosted: Wed Oct 30, 2013 22:33    Post subject: Reply with quote
I did miss that - sorry. Then I went back and did it and it worked. My bad.
ndewan
DD-WRT Guru


Joined: 14 Jan 2010
Posts: 553

PostPosted: Wed Oct 30, 2013 22:39    Post subject: Reply with quote
no big deal .. live and learn.

I am not very savvy with the DNSMasq entries,hoping someone else can step in and help.

All i will say is be careful with any DIY effort. You won't brick the router, but could make it un responsive from the client machines. The only way out is to go is to use telnet/ssh to get to a terminal session and then undo what you have done .. It can get a little labor intensive, so be careful.

_________________
===================================
1 * DIR-866L - 29193 Mega (Main Gateway)
1 * EA4200 - 29193 Mega (Main Gateway)
1 * EA6500 - 29193 Mega (Repeater Bridge)
1 * EA6500v2 - 29193 Mega (Repeater Bridge)
1 * WRT610N - 29193 Mega (Repeater Bridge)
===================================
magdiel1975
DD-WRT Novice


Joined: 12 Jul 2012
Posts: 10

PostPosted: Sun May 22, 2016 17:22    Post subject: Reply with quote
warmweatherjoe wrote:
I did miss that - sorry. Then I went back and did it and it worked. My bad.


This is a very old thread..but what you are looking for is this..
put this in the commands section...

tlds="com ae af ag off.ai am ar as at au az ba bd be bg bi bo br bs bw bz ca cd cg ch ci co.ck cl co co.cr cu de dj dk dm do ec es et fi fj fm fr gg gi gl gm gr gt hk hn hr co.hu co.id ie co.il co.im co.in is it co.je jm jo co.jp co.ke kg co.kr kz li lk co.ls lt lu lv ly mn ms mt mu mw mx my na nf ni nl no np nr nu co.nz om pa pe ph pk pl pn pr pt py ro ru rw sa sb sc se sg sh sk sn sm sv co.th tj tm totp tr tt tw ua co.ug co.uk uy uz vc co.ve vg co.vi vn vu ws co.za co.zm"

mkdir -m 777 -p /tmp/etc/dnsmasq/hosts


{

for tld in $tlds

do

echo "216.239.38.120 www.google.$tld"

done

} > /tmp/etc/dnsmasq/hosts/safesearh.hosts


that will force SafeSearch to ALL GOOGLE domains.
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
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