A script to configure multiple Openwrt routers all connected to the same switch
Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
c-test1.txt
commands.sh
commands2.sh
nodes.csv
owrtconfig.sh
scp-loop.sh

README

DESCRIPTION
===========

Owrtconfig is a script that configure multiple Openwrt routers all connected to
the same switch.
It has been used at the Wireless Battle Mesh second edition (WBMv2) in order to
configure multiple foneras running Openwrt, and freshly flashed with the
default firmware (all the foneras has the default IP 192.168.1.1).
It changes the ARP cache to communicate with each router.
It loads a list of nodes (nodes.csv) and a list of commands to execute on each
router (commands.sh), and it can also upload files.

DEPENDENCIES
============

Please check that your system has the following commands (beware that
stripped-down versions of those provided by busybox might not work):

cat echo sudo arp ping ssh nc tail

TESTED ON
=========

Ubuntu Karmic (9.10)

USAGE
=====

./owrtconfig -telnet nodes.csv commands.sh
./owrtconfig -ssh nodes.csv commands.sh
./owrtconfig -scp nodes.csv commands.sh

NODES.CSV
=========

The input hosts file format (nodes.csv) is:

MAC,PARAM1,PARAM2,PARAM3,PARAM4,PARAM5,PARAM6,PARAM7,PARAM8,PARAM9

where:

* MAC: MAC address (ex: 00:18:84:29:b0:0c)
* PARAM1: hostname (ex: node01)
* PARAM2: wired IP address (ex: 192.168.20.1)
* PARAM3: wireless IP address (ex: 192.168.50.1)
* PARAM4: Not Used
* PARAM5: channel (ex: 11)
* PARAM6: adhoc cell (ex: 02:02:02:02:aa:aa) (adhoc cells needs to start with 02: ?)
* PARAM7: return-routes (ex: route add -net 192.168.20.0/24 gw 192.168.20.1)
* PARAM8: forward-routes (ex: route add -net 192.168.6.0/24 gw 192.168.4.2  && route add -net 192.168.15.0/24 gw 192.168.4.2  && route add -net 192.168.5.0/24 gw 192.168.4.2)
* PARAM9: Not Used

SSH KEYS
========

Look on this website howto setup ssh keys for automatic login:
http://telscom.ch/?p=217

TODO
====

* --Add a switch (-telnet -ssh -copy) instead of having near three identical scripts--
* Add a switch for -scp
* --Document the format of nodes.csv--
* Make a check on dependencies
* --Document howto generate ssh keys--

AUTHORS
=======

Nicolas Thill <nico@openwrt.org>
Pieter Heremans <pieter@l45.be>
Benjamin Henrion <bh@udev.org>

LICENCE
=======

GPLv2

LINKS
=====

* http://battlemesh.org/BattleMeshV3/NodeConfigScript
* http://hackerspace.be/Wbm2009v2/NodeConfigurationFactory
* http://hackerspace.be/Wbm2009v2/NodeConfig
* http://hackerspace.be/Wbm2009v2/ConfigExpectScript
* http://www.zoobab.com/fonera