I'm away from a network and unable to use my RPi. I've got a laptop with a SD card reader, would it be possible to mount the SD card in the laptop and configure the ethernet interface on the Pi with a static IP, then configure the laptop with another static address on the same subnet, then use an ethernet cable between the two so I can then continue to use the RPi via SSH? What file on the Pi do I need to edit?
Yes, if you have a Linux distribution, you can easily mount the SD and change the contents on the SD file system.
As Kibbee wrote, you need to change the content in
/etc/network/interfaces on the SD-card if you want static IPv4 addresses. You also need to change the contents in
/etc/resolv.conf on the SD-card as Alex wrote. As that is also information you get through dynamic addresses.
But a better solution would be to install Avahi on your raspberry instead of setting a static address if you plan to move the Raspberry Pi between networks. Then the Raspberry will tell Apple computers and other Linux boxes with avahi installed what IP address your Raspberry Pi got. So you can connect without knowing the IP address.
sudo aptitude install avahi-discover avahi-utils avahi-autoipd
and then you can test this on the other computers
getent hosts raspberrypi.local avahi-util -a
or try this
to connect to your Raspberry Pi.
You might want to check out
/usr/share/doc/avahi-daemon/examples/ for some examples you can move into
/etc/avahi/services/ to post more information from avahi. If you want to use IPv6, check out
/etc/avahi/avahi-daemon.conf so that avahi works with IPv6 too.
You need to edit the file
iface eth0 inet dhcp
auto eth0 iface eth0 inet static address 192.168.1.90 gateway 192.168.1.1 netmask 255.255.255.0
Make sure whichever subnet you use, that it is different then the subnet used by your wireless card. If you are using Windows, you can install VirutalBox, and set up Linux in order to be able to edit the file, since Windows can't read the ext4 partition on the SD card. You should then be able to connect to you Raspberry Pi by connecting an ethernet cable directly between the laptop and the Pi. This is how I have mine set up.
Also, if you are using Windows, you can set up Internet Connection Sharing. This will allow you to access the internet from your Raspberry Pi.
You need to edit
/etc/rc.conf. Using the example from the Arch Linux Beginners' Guide, a static IP setup would look similar to
HOSTNAME="arch" interface=eth0 address=192.168.1.100 netmask=255.255.255.0 broadcast=192.168.1.255 gateway=192.168.1.1
You should also edit
/etc/resolv.conf. You can probably use
nameserver 192.168.1.1, or if that doesn't work you could use Google's Public DNS,