OpenDNS and XO?

Discuss solutions for wired and wireless usage for sharing and Internet connectivity.

OpenDNS and XO?

Postby keybsnbits » Fri Feb 01, 2008 5:42 pm

I've been trying to set up OpenDNS (for adult filtering) on my XO laptop, and I can't seem to get it to work. I've followed these tutorials:

http://jbowes.dangerouslyinc.com/2006/1 ... ra-core-6/
http://forums.fedoraforum.org/showthread.php?t=156490

Neither seem to work. Anybody have tips on getting OpenDNS up and running on an XO laptop? Thanks a lot in advance.
keybsnbits
 
Posts: 6
Joined: Fri Feb 01, 2008 5:38 pm

Re: OpenDNS and XO?

Postby Ben James Ben » Fri Feb 01, 2008 11:19 pm

I'm not easily able to test this out myself (because my router is already configured to use OpenDNS directly). However, it seems that these instructions should work:

Code: Select all
$ su -l
# echo "prepend domain-name-servers 208.67.222.222, 208.67.220.220;" > /etc/dhclient.conf
# service network restart

No other steps are needed. It should not be necessary to delete cached pages because /home/olpc/.sugar/default/gecko/Cache seems to get destroyed automatically whenever Browse starts. I don't think that it should be necessary to restart the laptop, though I don't know how DNS lookups are cached.
Ben James Ben
 
Posts: 32
Joined: Sat Jan 26, 2008 10:10 pm

Re: OpenDNS and XO?

Postby keybsnbits » Sat Feb 02, 2008 2:46 am

It seems as if whenever I disconnect from a wifi network, dhclient.conf gets changed to some mesh settings, and whenever I restart the network service, it gets completely cleared out. Any ideas guys?
keybsnbits
 
Posts: 6
Joined: Fri Feb 01, 2008 5:38 pm

Re: OpenDNS and XO?

Postby Ben James Ben » Sat Feb 02, 2008 3:38 am

I confirm that the same thing happens on my laptop. I tried to find the code that changes the dhclient.conf file, but wasn't able to locate it tonight. This article suggests that it should be possible to use a /etc/dhclient-eth0.conf file instead. If true, then perhaps that file won't get overwritten... I just tried it out, and /etc/dhclient-eth0.conf does not get overwritten or deleted even when connecting/disconnecting to/from router/mesh.

Again, I am not able to test this myself, but please try the fix using the dhclient-eth0.conf file;
Code: Select all
$ su -l
# echo "prepend domain-name-servers 208.67.222.222, 208.67.220.220;" > /etc/dhclient-eth0.conf
# service network restart
(Actually, I'm not sure whether you might need to restart Sugar or the laptop, rather than just the network service.)

Also, I'm not sure whether eth0 or msh0 should be used, but I think that eth0 is correct.
Ben James Ben
 
Posts: 32
Joined: Sat Jan 26, 2008 10:10 pm

Re: OpenDNS and XO?

Postby keybsnbits » Sat Feb 02, 2008 1:49 pm

I forgot to thank you last night for your help. I really appreciate it. Unfortunately, this fix did not work. The new dhclient-eth0.conf does not get overwritten, but I don't think it ever gets read (or is overwritten somehow). The resolv.conf file is still written out by the networkmanager, and the DNS servers are taken from the router the computer is connecting to.

Before anybody says I should just set up the router to use the OpenDNS servers, let me explain. I am working on a small XO pilot program, and although we have good adult filtering while the students are within our schools, we have no control once they leave. OpenDNS provides adult/violent site filtering, and we're hoping to take advantage of this to keep the students safe when they are on public wifi hotspots.

Thanks for everybody's help in advance.
keybsnbits
 
Posts: 6
Joined: Fri Feb 01, 2008 5:38 pm

Re: OpenDNS and XO?

Postby Ben James Ben » Sat Feb 02, 2008 7:21 pm

Doing more research, it appears that /etc/dhclient-eth0.conf only works for certain flavors of Linux. The XO version uses /etc/dhclient.conf instead.

I'm going to look into this problem further. Two areas of interest:
1. It appears that some OLPC-specific code is overwriting /etc/dhclient.conf . Hopefully, a search of the laptop will reveal the culprit.
2. I note that dhclient itself can be set to use a "-cf <configfile>" flag. Not the best solution, but perhaps the script (probably an /etc/rc.d script) that starts dhclient can be hardcoded to use our special dhclient.conf file instead of the default one. I imagine that doing this will break things if the mesh is used and the expected OLPC lines in dhclient.conf are not there.

This particular problem is very important because its fix would be the Grail-- a way that OLPC can be protected from accusations of giving children access to adult and pornographic web sites.
Ben James Ben
 
Posts: 32
Joined: Sat Jan 26, 2008 10:10 pm

Re: OpenDNS and XO?

Postby Ben James Ben » Sun Feb 03, 2008 1:15 am

Bad news. It appears that both #1 and #2 are done by /sbin/NetworkManager. And, unfortunately, NetworkManager is compiled, so it can't be changed easily. I'm not sure where the source code is for NetworkManager-- I think that OLPC has their own version.

I'm working on a workaround that overwrites /etc/resolv.conf whenever the laptop starts up. My thought is to do it by hacking keyhandler.py (to overwrite the file whenever the Enter key or any other special XO key is pressed).

Unfortunately, if you make an error editing keyhandler.py, you can wedge your system. That's what happened to me tonight, and now have to buy a USB key drive and re-install the OS in order to get my laptop to work again.
Ben James Ben
 
Posts: 32
Joined: Sat Jan 26, 2008 10:10 pm

Re: OpenDNS and XO?

Postby ektoric » Sun Feb 03, 2008 5:12 pm

(ignore this message) I don't know how to manually mark/flag/subscribe to a thread, but posting seems to do the trick. I'd like to do some research on this, but would hate to have to search for this thread again =)
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: OpenDNS and XO?

Postby keybsnbits » Sun Feb 03, 2008 5:29 pm

Ben James Ben wrote:I'm working on a workaround that overwrites /etc/resolv.conf whenever the laptop starts up. My thought is to do it by hacking keyhandler.py (to overwrite the file whenever the Enter key or any other special XO key is pressed).


My question to you is whether or not this will mess with the mesh capabilities. Later tonight I'll post what the XO outputs to the resolv.conf file when it is in mesh networking mode. This way, we'll know whether or not what we're doing will be destructive.

Ben James Ben wrote:Unfortunately, if you make an error editing keyhandler.py, you can wedge your system. That's what happened to me tonight, and now have to buy a USB key drive and re-install the OS in order to get my laptop to work again.


I'm so sorry to hear that Ben. With the XO's memory, however, it may not be a horrible purchase. Again, thanks for helping.

With this problem, it almost feels as if some lower-level changes need to be made the network handlers... this should be an easy option to set (in my opinion). In fact, it should be as easy as just running a command like

Code: Select all
sugar-control-panel -d1  208.67.222.222 -d2  208.67.220.220


I hope this thread is getting the attention of more OLPC people.
keybsnbits
 
Posts: 6
Joined: Fri Feb 01, 2008 5:38 pm

Re: OpenDNS and XO?

Postby Ben James Ben » Tue Feb 12, 2008 12:42 am

I haven't given up on this project. I just need to think about it a little longer. To get the XO to use OpenDNS for name services, /etc\resolv.conf should be overwritten to be:
Code: Select all
nameserver 208.67.220.220
nameserver 208.67.222.222

We can easily write a little script that does this. The question is then, how and when do we run the script?

1. Run it whenever the networking connects. One of the hooks would be in \usr\share\sugar\shell\view\devices\network\wireless.py and the other in mesh.py. The function is _update_state(). However, because NetworkManger runs in the background, we can't be sure that changing \etc\resolv.conf at the time of connection is enough. (NetworkManager could subsequently overwrite the file.)
1a. To deal with that situation, consider editing the script to copy the file once, then sleep a set amount of time, then copy the file a second time. Or, consider having the script sleep a few seconds, copy the file, and then repeat for a minute or two.
2. Run it via a cron job, perhaps once every minute. This seems like overkill.
3. Run it every time the user presses a key. That's what I was trying to do with keyhandler.py.

Choices 1 and 1a seem to be the best ways to do it. We should do some testing to see exactly how long after network connection does NetworkManager cause \etc\resolv.conf to be overwritten. Also, we need to check to make sure wireless.py._update_state() gets called in the background, not just when the user is viewing the Home screen. If the latter is the case, then choices 1 and 1a won't work./
Ben James Ben
 
Posts: 32
Joined: Sat Jan 26, 2008 10:10 pm


Return to Networking / Internet

Who is online

Users browsing this forum: No registered users and 2 guests

cron