<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>BattleMeshV3/NodeConfigScript/Babel</title><revhistory><revision><revnumber>3</revnumber><date>2010-06-03 19:26:24</date><authorinitials>213.233.60.166</authorinitials></revision><revision><revnumber>2</revnumber><date>2010-06-03 19:25:17</date><authorinitials>213.233.60.166</authorinitials></revision><revision><revnumber>1</revnumber><date>2010-03-23 19:53:44</date><authorinitials>ptr_here</authorinitials></revision></revhistory></articleinfo><para>BattleMeshV3/NodeConfigScript/Babel </para><para>* this script uses opkg to download and install packages, be sure it has a gateway etc configured (look at the <ulink url="http://www.battlemesh.org/BattleMeshV3/NodeConfigScript/Babel/Zlan#">Zlan</ulink> and adapt it to your need) </para><screen><![CDATA[
opkg update
opkg install kmod-ipv6
opkg install babeld
]]><![CDATA[
set -a
]]><![CDATA[
HOSTNAME="@PARAM1@"
WIRED_IP="@PARAM2@"
WIRELESS_IP="@PARAM3@"
CHANNEL="@PARAM4@"
CELL="@PARAM5@"
]]><![CDATA[
# setting wireless config
DEVICE=`uci get wireless.@wifi-iface[0].device`
uci delete wireless.$DEVICE.disabled
uci delete wireless.@wifi-iface[0].network
#uci delete wireless.@wifi-iface[0].rate
]]><![CDATA[
uci set wireless.$DEVICE.channel=$CHANNEL
uci set wireless.$DEVICE.hwmode=11g
uci set wireless.$DEVICE.txpower=20
]]><![CDATA[
uci set wireless.@wifi-iface[0].network=wlan
uci set wireless.@wifi-iface[0].ssid=wbm_babel
uci set wireless.@wifi-iface[0].encryption=none
uci set wireless.@wifi-iface[0].bssid=$CELL
uci set wireless.@wifi-iface[0].rate=54M
uci set wireless.@wifi-iface[0].bgscan=0
uci set wireless.@wifi-iface[0].bgscan=ahdemo
]]><![CDATA[
uci set network.wlan=interface
uci set network.wlan.proto=static
uci set network.wlan.ipaddr=$WIRELESS_IP
uci set network.wlan.netmask=255.255.255.0
uci commit wireless && wifi
uci commit network
]]><![CDATA[
#[edit] Configure the daemon
#
uci delete  babeld.wlan.ignore
uci commit babeld
]]><![CDATA[
#[edit] Enable the daemon
#
[ -f /etc/init.d/babeld ] && {
  /etc/init.d/babeld enable
  /etc/init.d/babeld start
} || { 
  echo " ERROR: babeld init script not found" 
  exit 1
}
]]><![CDATA[
]]><![CDATA[
#[edit] Disable the daemon
#
#[ -f /etc/init.d/babel ] && {
#  /etc/init.d/babeld stop
#  /etc/init.d/babeld disable
#}
]]><![CDATA[
reboot 
exit]]></screen><para>The following should be put in /etc/babeld.conf.  (Note that this could probably be done with uci -- merci Gabriel -- but I'm not sure how.) </para><screen><![CDATA[redistribute local ip 10.10.42.0/24 allow
redistribute local ip fdba:1943:e753::/64 allow
redistribute local deny
]]><![CDATA[
in ip 10.10.42.0/24 allow
in ip fdba:1943:e753::/64 allow
in deny]]></screen></article>