09.11.2012 Views

Contents - Raspberry PI Community Projects

Contents - Raspberry PI Community Projects

Contents - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

to do it ;) ). This file contains all of the keys authorised to connect to the Pi, so<br />

will probably be blank or non-existent on a new Pi. If so, just copy id_rsa.pub to<br />

this location. If it already exists, add the key from id_rsa.pub to the end of the<br />

file.<br />

▪ Step 2: IP address config. If your Pi is going to be always-on, or your network<br />

is set up in a such a way that devices always get the same IP, you can skip the<br />

step. However, if your Pi's IP is likely to change frequently (say, for instance,<br />

you're just powering it up every so often to play, and your network assigns IPs<br />

first-come first-served {like most home routers} ), it's a good idea to set up a<br />

consistent network address for your Pi. There's two ways to do this: the quick<br />

(but brittle) way and the more flexible way.<br />

▪ The quick way: assign a static IP address to your Pi. This is simple,<br />

but runs the risk of clashing IP addresses with other devices on your<br />

network since your Pi's address will no longer be managed by DHCP. I<br />

haven't tried this myself, but here's some instructions from Andrew<br />

Munsell (http://blog.andrewmunsell.com/post/24830266512/setting-upthe-raspberry-pi-as-a-headless-device)<br />

. He's using 192.168.1.222 for his<br />

Pi, since that's outside the range assigned by his router. Change this<br />

address to whatever suits.<br />

You can do this in Debian Squeeze on the <strong>Raspberry</strong> by modifying the /etc/network/interfaces<br />

I removed the original iface eth0 line and replaced it with the following:<br />

iface eth0 inet static<br />

address 192.168.1.222<br />

netmask 255.255.255.0<br />

gateway 192.168.1.1<br />

On reboot, your Pi should now be using the static address specified in<br />

/etc/network/interfaces.<br />

▪ The flexible way: set up avahi / zeroconf. Zeroconf is 'a set of<br />

techniques that automatically creates a usable Internet Protocol (IP)<br />

network without manual operator intervention or special configuration<br />

servers.'[3] (http://en.wikipedia.org/wiki/<br />

Zero_configuration_networking) . Avahi is an implementation of<br />

zeroconf which 'ships with most Linux and *BSD distributions'[4]<br />

(http://en.wikipedia.org/wiki/Avahi_(software)) , but not the Pi's Debian<br />

distro. Zeroconf will be familiar to Apple users as Bonjour, and is pretty<br />

clever tech which means that things Just Work when sharing stuff across<br />

computers on a network. In this context, it means that once we've set it<br />

up on the Pi, we'll be able to address it as:<br />

raspberrypi.local<br />

regardless of what IP address it's been assigned on your local network.<br />

This is handy if its IP is likely to change regularly, and even means we'll

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!