NodeBuildWalkThrough

From SOWNWiki
Jump to: navigation, search

These instructions explain how to build a '386-based' machine, or 'Meraki Mini' into a SOWN node.

All our SOWN[at]HOME Nodes (and some of the campus) nodes run OpenWrt. If you need to use the serial interface, the baud-rate defaults to 38400:

 stty -F /dev/ttyS0 38400

Install the Operating System

This describes the process of installing a pre-compiled version of [OpenWRT] Kamikaze 7.09 on a x86 based WRAP board:

1. Download the ext2 image from [OpenWRT]'s site

wget http://downloads.openwrt.org/kamikaze/7.09/x86-2.6/openwrt-x86-2.6-ext2.image


2. Copy this image to the compact flash card

dd if=./openwrt-x86-2.6-ext2.image of=/dev/sda

This assumes that you have connected the compact flash card to your computer via a USB to CF adapter. You can find out what device the CF card is connected to by issuing the command

fdisk -l

as root. You should get something like:

Disk /dev/Sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          62      497983+  83  Linux
/dev/hda2              63         685     5004247+  82  Linux swap

Disk /dev/sda: 256Mb, 256361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

You want the 256Mb drive. If partitions are already mounted on that device it is probably worth un-mounting them.


3. If your network card is not ne2000 based you will need to install the driver. For example, most pc-motherboards have an on-board realtek-8139 chip. Download the driver package:

wget http://downloads.openwrt.org/kamikaze/7.09/x86-2.6/packages/kmod-8139too_2.6.22-x86-1_i386.ipk

Mount the second partition on the disk your created in 2, then copy the driver 'ipkg' file to the root directory. Once openwrt has booted you can install this driver with:

 ipkg install ./kmod-8139too_2.6.22-x86-1_is86.ipkg


4. You should now be able to boot the image however before you do it is worth mounting the device and first setting up the networking on the board. To do this open the file /etc/config/network and set the 'option ipaddr' to a free address on the network. Remove the line about bridging. The config file should look like this:

config interface loopback
       option ifname lo
       option proto static
       option ipaddr 127.0.0.1
       option netmask 255.0.0.0

config interface eth0
       option ifname eth0
       option proto static
       option ipaddr 10.13.0.100
       option netmask 255.255.255.0

So long as eth0 is on the SOWN VLAN you should be able to place the CF card in the board and boot the system. The address 10.13.0.100 is an example address, ask a committee member which address you should use!

Setup SSH public/private keys

  wget https://sown-auth.ecs.soton.ac.uk/config/authorized_keys --output-document=/etc/dropbear/authorized_keys
  • Ask a committee-member to add your nodes ssh-key to the 'know_hosts' file on sown-auth.

This step is vitally important, as auth cannot log into your new node unless it is told to trust it! Nodes ssh-public keys are held in the database, and are generated by the 'generateKnownHosts' script.

Create an inventory item

  • Visit the [Admin Interface] and click 'Hardware' under 'Admin Menu'.
  • At the top of the screen, click 'Add Item'.
  • Set the 'type' to 'node'.
  • Fill in all the appropriate details. If your hardware doesn't have and ECS-Stores bar code, please use the MAC address of its wired-interface instead. (without the colons).

Promote the inventory item to a node

  • Visit the [Admin Interface] and click 'Node Managment' under 'Admin Menu'.
  • Click 'View Inventory', find your node, and click 'Edit'.
  • Specify your node information, set the node 'type' to 'home' for a node tunneling back using openvpn.
  • Your node will only appear on the map if you specify a longitude and latitude.

Run the appropriate 'setup node' tasks

  • Visit the [Admin Interface] and click 'Node Managment' under 'Admin Menu'.
  • Select your node, and click 'Edit'.
  • At the top of the screen click 'Setup Node'.
  • If your node has vlan connectivity, and is accessible, the IP address will be filled in for your, otherwise, specify it here. The port-number is also a variable to allow port-forwarding.
  • Select the appropriate tasks. For a node tunneling back using openvpn, you want _all_ of them! For a campus node, omit *_openvpn, and *_tc.

Madwifi

If you have run this on a device using madwifi see the configuration options Madwifi