Author: bertsch Date: Mon Nov 30 13:34:34 2009 New Revision: 1886 Log: Added autoconfiguration files for linksys. Added: trunk/openwrt/router-configurations/auto-linksys/ trunk/openwrt/router-configurations/auto-linksys/etc/ trunk/openwrt/router-configurations/auto-linksys/etc/banner (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/config/ trunk/openwrt/router-configurations/auto-linksys/etc/config/dhcp (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/config/dropbear (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/config/firewall (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/config/httpd (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/config/network trunk/openwrt/router-configurations/auto-linksys/etc/config/ntpclient (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/config/system trunk/openwrt/router-configurations/auto-linksys/etc/config/wireless trunk/openwrt/router-configurations/auto-linksys/etc/dropbear/ trunk/openwrt/router-configurations/auto-linksys/etc/dropbear/authorized_keys (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/hip (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/hosts (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/opkg.conf (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/pisa (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/rc.local (contents, props changed) trunk/openwrt/router-configurations/auto-linksys/etc/rc.local.default (contents, props changed) Added: trunk/openwrt/router-configurations/auto-linksys/etc/banner ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/banner Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../files/etc/banner \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/dhcp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/dhcp Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../../files/etc/config/dhcp \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/dropbear ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/dropbear Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../../files/etc/config/dropbear \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/firewall ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/firewall Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../../files/etc/config/firewall \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/httpd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/httpd Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../../files/etc/config/httpd \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/network ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/network Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1,32 @@ +#### VLAN configuration +config switch eth0 + option vlan0 "0 1 2 3 4 5u" + + +#### Loopback configuration +config interface loopback + option ifname "lo" + option proto static + option ipaddr 127.0.0.1 + option netmask 255.0.0.0 + + +#### LAN configuration +config interface lan + option type bridge + option ifname "eth0" + option proto static + option ipaddr 192.168.8.1 + option netmask 255.255.255.0 + + +#### WAN configuration +config interface wan + option ifname "eth1" +# option proto dhcp + option proto static + option ipaddr 192.168.5.254 + option netmask 255.255.255.0 + option gateway 192.168.5.1 + option dns 134.130.5.1 + option dns 134.130.4.1 Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/ntpclient ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/ntpclient Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../../files/etc/config/ntpclient \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/system ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/system Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1,5 @@ +config system + option hostname pisa-autoconf + #option timezone UTC + option zonename 'Europe/Berlin' + option timezone 'CET-1CEST,M3.5.0,M10.5.0/3' Added: trunk/openwrt/router-configurations/auto-linksys/etc/config/wireless ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/config/wireless Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1,14 @@ +config wifi-device wlan0 + option type mac80211 + option channel ##ROUTER_CHANNEL## + option macaddr ##ROUTER_WIFI_MAC## + option hwmode_11n g + #option ht_capab '[SHORT-GI-40][DSSS_CCK-40][HT40-][HT40+][HT20]' + option ht_capab '[HT20]' + +config wifi-iface + option device wlan0 + option network lan + option mode ap + option ssid pisa-testbed-##ROUTER_NAME## + option encryption none Added: trunk/openwrt/router-configurations/auto-linksys/etc/dropbear/authorized_keys ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/dropbear/authorized_keys Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../../files/etc/dropbear/authorized_keys \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/hip ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/hip Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../files/etc/hip/ \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/hosts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/hosts Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../files/etc/hosts \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/opkg.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/opkg.conf Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../files/etc/opkg.conf \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/pisa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/pisa Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1 @@ +link ../../../files/etc/pisa/ \ No newline at end of file Added: trunk/openwrt/router-configurations/auto-linksys/etc/rc.local ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/rc.local Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1,61 @@ +#!/bin/sh +# +# PISA Autoconf +# This script configures a router on first boot for use within the PISA +# project. +# +# Configuration is read from webserver with an url of the form +# http://HOSTNAME/autoconf/ROUTER-MAC."; For example +# http://192.168.5.1/autoconf/00-0F-A3-1A-11-91"; +# +# +# Copyright (c) 2009, Distributed Systems Group, RWTH Aachen +# All rights reserved. +# +# Relies on the '-i' GNU extension for sed. + +replace () { + sed -i "s/$2/$3/g" $1 +} + +echo "PISA autoconf" + +### get mac ### +MAC=$(ifconfig wlan0|grep HWaddr|awk '{print $5}') +MAC=$(echo $MAC|sed -e 's/:/-/g') + + +### get and read router configuration file from webserver ### +CONFIG_URL="http://192.168.5.1/autoconf/$MAC"; + +echo "Getting configuration from $CONFIG_URL" +wget $CONFIG_URL +. $MAC +rm $MAC + +echo "Configuring with" +echo "ROUTER_NAME $ROUTER_NAME" +echo "ROUTER_NUMBER $ROUTER_NUMBER" +echo "ROUTER_WIFI_MAC $ROUTER_WIFI_MAC" +echo "ROUTER_CHANNEL $ROUTER_CHANNEL" + + +### do configuration ### +echo "Configuring /etc/config/wireless" +replace /etc/config/wireless "##ROUTER_NAME##" $ROUTER_NAME +replace /etc/config/wireless "##ROUTER_NUMBER##" $ROUTER_NUMBER +replace /etc/config/wireless "##ROUTER_WIFI_MAC##" $ROUTER_WIFI_MAC +replace /etc/config/wireless "##ROUTER_CHANNEL##" $ROUTER_CHANNEL + +echo "Configuring /etc/config/system" +replace /etc/config/system pisa-autoconf pisa-$ROUTER_NAME + +echo "Configuring /etc/config/network" +replace /etc/config/network 254 $ROUTER_NUMBER + + +### self destruct ### +mv /etc/rc.local.default /etc/rc.local + +### apply changes ### +reboot Added: trunk/openwrt/router-configurations/auto-linksys/etc/rc.local.default ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/openwrt/router-configurations/auto-linksys/etc/rc.local.default Mon Nov 30 13:34:34 2009 (r1886) @@ -0,0 +1,4 @@ +# Put your custom commands here that should be executed once +# the system init finished. By default this file does nothing. + +exit 0