Our network is driven by a teeny, tiny box
Earlier this year I got a SheevaPlug, a little box with some Flash memory and an ARM processor running Linux. It’s so friggin’ awesome! (Technical term.) My main motivation for getting it, aside from a cool toy, was its much lower power consumption compared to the Mac Mini.
For a few years now our Mini had been doing most of the maintenance efforts for our home network, including: DHCP; DNS; running the No-IP client so I can SSH in via our dynamic DSL connection with its random addresses; acting as a printer server; and work as a local NTP server (still to do). (My email folders were also on the Mini thru an IMAP server, but I’ve moved that onto my desktop for the moment.)
The SheevaPlug is now doing all of it. In particular, I’m finding name lookups for Web browsing is vastly faster than when the Mini was doing the effort.
This list offers the details of what I’ve done to use the SheevaPlug. I’ll add to it (to mirror my local ChangeLog) as we make any other tweaks or fixes. It’s not a lot of effort and the end result is great.
(Note: I still need to finish fixing the formatting of this for readability.)
- As noted on “SheevaPlug”, edit
/etc/dhcp3/dhclient.conf
and comment out the the line
#OFF#supersede domain-name-servers 127.0.0.1;
- Ran
dhclient eth0
- Make sure APT will work by doing:
mkdir -p /var/cache/apt/archives/partial
- Install ntpdate with
apt-get install ntpdate
. - Edit
/etc/rc.local
and comment out the line
#date 012618002009
and add
ntpdate ntp.maths.tcd.ie
- Edit
/etc/hostname
and change the name from ‘debian
‘ to ‘inara
‘. - I should note the boot sequence for the SheevaPlug still specifies a different subnet:
Nov 14 13:52:19 inara kernel: Kernel command line: console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none
- * /etc/rc.local: Comment out
#OFF#insmod /boot/fat.ko
#OFF#insmod /boot/vfat.ko
and add
chmod 1777 /tmp /var/tmp - Edit /etc/fstab and add the lines
tmpfs /var/log tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0to make the most frequent activity not actually write anything out to the flash memory. Too many writes to flash can accelerate its demise.
- Also change the root partition in /etc/fstab to specify noatime to also reduce unnecessary “disk” writes:
rootfs / rootfs rw,noatime 0 0
- Install wget (to download stuff), sysstat (to see how things are running), and rsync (to download/upload stuff) with : sudo apt-get install wget sysstat rsync
- Update the list of packages, then install NTP: sudo apt-get update && sudo apt-get install ntp
- Edit /etc/ntp.conf and change the server line to be the Trinity College server: server ntp.maths.tcd.ie
- As suggested on “New Plugger How To”, ran dpkg-reconfigure tzdata
and selected Europe -> Dublin. - Follow the instructions at “Setting Up Serial Console Under Linux”
- On my desktop (running Ubuntu 9.04), ran
* On homer:
sudo /sbin/modprobe -q ftdi-sio product=0x9e8f vendor=0x9e88
sudo apt-get install cu
sudo chown uucp /dev/ttyUSB1
so I can then log into the SheevaPlug over a serial line with
* sudo cu -s 115200 -l /dev/ttyUSB1
This is really helpful when you make a typo and the box is no longer getting on your network properly! - Edited /etc/network/interfaces and changed it from doing DHCP to a static address:
auto eth0
#iface eth0 inet dhcp
# /usr/share/doc/ifupdown/examples for more information.
iface eth0 inet static
address 192.168.20.8
network 192.168.20.0
netmask 255.255.255.0
broadcast 192.168.20.255
gateway 192.168.20.1 - Installed the DHCP server with: apt-get install dhcp3-server
- Copied the /etc/dhcpd.conf file over from the Mini.
- Install BIND with: apt-get install bind9
- Edit /etc/bind/named.conf.local and add
options {
// use this to get faster lookups that we cache:
forward first;
forwarders {
// Eircom:
// BACKUP plan when DoS attacks hit eircom (2009-09-02)
159.134.237.6;
159.134.248.17;
// as per http://broadbandsupport.eircom.net/ under Broadband Settings:
// 213.94.190.194;
// 213.94.190.236;
// Try going straight to the Netopia box
// 192.168.20.1;
};
allow-query { localhost; 192.168.20.0/24; };
allow-transfer { localhost; };};
zone “20.168.192.in-addr.arpa” IN {
type master;
file “192.168.20”;
};
zone “network.home” IN {
type master;
notify no;
file “network.home”;
}; - Add files /etc/bind/192.168.20 and /etc/bind/network.home from the Mini.
- Get GCC off the CD that comes with the SheevaPlug box in SheevaPlug_Host_SWsupportPackageLinuxHost.zip.
- Extract gcc.tar.bz2 from it, then extract files from that.
- Download No-IP.
- Extract the noip sources; may be in a directory noip-2.1.9-1.
- Expecting ‘gcc’ and ‘noip-2.1.9-1’ are in the same directory, edit the makefile to have
CC=../gcc/bin/arm-none-linux-gnueabi-gcc -O3
- Do ‘cd noip-2.1.9-1’ and ‘make’, then copy the binary to /usr/local/bin/noip2.
- Run “/usr/local/bin/noip2 -C” and answer its questions; you’ll need to have registered on no-ip.com to have a username and password to use with this free client.
- Create the file /etc/init.d/noip2 using the example at http://www.togaware.com/linux/survivor/No_IP.html.
- Do “chmod 755 /etc/init.d/noip2” and then “update-rc.d noip2 defaults” so it’ll run when you boot.
- Accessing the box
After initial power-on, logged in as
root
with the default password nosoup4u
. Then I changed the root password to something I’m used to typing.
- General Usability
- Network Time Support
- Logging in over the USB serial port
- Network Connection
- DHCP Server
- DNS Server
- No-IP Client