The Kindle and the XS

The Kindle 3’s default networking stack doesn’t support the XS’s network scheme, so DHCP won’t work.  However, we can manually connect with a static IP.  Tested and verified on a Kindle 3 (wifi and 3G) running Firmware 3.1.

I was a bit stymied at first, as I could see the DHCP offer in /var/log/messages, but some googling around told me this is a common issue.

From Menu -> Settings, look at the Device Info to get the Kindle’s MAC address.  Mine is 28:ef:01:32:bc:88

Edit this file:

/etc/sysconfig/olpc-scripts/dhcpd.conf.1

On XS 0.6, the 172.18.126.0/24 range is outside of DHCP, so this step really isn’t necessary.  However, I have other devices on this range and I like to keep notes about what’s where.  So, I’m going to go ahead and specify the kindle’s static IP in the DHCP configuration file.

The hostname doesn’t have to be kindle, but try to be descriptive.  Simply put this line at the bottom of the dhcpd.conf.1 file, making sure to supply the correct MAC address.  And make sure the static IP you specify isn’t being used by anything else.

host kindle {hardware ethernet 28:ef:01:32:bc:88; fixed-address    172.18.126.100;}

Restart dhcpd after the edit.

service dhcpd restart

On the Kindle, try to connect to the XS’s wifi AP.  After a minute or so it’ll fail to connect and then give you the option to manually configure the network.  Here’s what I put:

IP Address 172.18.126.100
Subnet Mask 255.255.224.0
Router 172.18.96.1
DNS 208.67.222.222

I’m using OpenDNS, but you can use your ISPs or (probably, I haven’t tested) the XS’s 172.18.0.1.  The two opendns IPs are:

208.67.222.222
208.67.220.220

Try to connect again and it should work.  The Kindle doesn’t respond to ping, but you can verify connectivity server side by getting a response from

nmap -sS 172.18.126.100

It should look like:

[root@schoolserver ~]# nmap -sS 172.18.126.100

Starting Nmap 4.53 ( http://insecure.org ) at 2011-03-26 19:36 CDT
All 1714 scanned ports on 172.18.126.100 are filtered
MAC Address: 28:EF:01:32:BC:88 (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 63.603 seconds

When you go to http://schoolserver from the Kindle, this is what the user agent looks like in the Apache log.

172.18.0.1 – – [22/Mar/2011:16:36:13 -0500] “GET / HTTP/1.0” 200 1850 “-” “Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600×800; rotate)”

XO Internet Sharing with F11 Builds

My original OLPC News Post for Debian/Ubuntu on the XO:
http://www.olpcnews.com/forum/index.php?topic=4748.0

These directions work with F11 on the XO-1, but I’ve only tested os860.  YMMV and all that.

860 has dnsmasq already installed.  So it’s a “simple” matter of configuration.

Do this:

echo 1 > /proc/sys/net/ipv4/ip_forward

Edit /etc/sysctl.conf with these lines at the bottom:

net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1

Back up the dnsmasq config file:

mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak

Create this file:  /etc/dnsmasq.conf

interface=eth1
dhcp-range=172.18.0.100,172.18.0.150,24h
dhcp-leasefile=/var/lib/misc/dnsmasq.leases
cache-size=20

Create this file:  /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
ONBOOT=yes
TYPE=Wired
IPADDR=172.18.0.1
NETMASK=255.255.0.0

Enter these lines at the bottom of /etc/rc.local:

iptables -A FORWARD -i eth0 -o eth1 -s 172.18.0.0/24 -m state –state NEW -j ACCEPT
iptables -A FORWARD -m state –state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
service iptables save

Start dnsmasq on boot (or not.  You can always do service dnsmasq start as needed.)

chkconfig –level 345 dnsmasq on

Reboot.  Connect the XO to the internet as usual.  Bring up your USB ethernet device:

sudo ifup eth1

And now anything on the other end should be getting internet.

Remember after every reboot you’ll have to:

sudo ifup eth1

To get that functionality.

You should be able to connect any wired device, even a wifi AP.  Though the wifi AP will need further configuration.