Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
In which Country is ninux.org based?

Italiano English
Edit History Actions

Firenze/OONF

OLSRv2

Compilazione/Installazione

OpenWRT/LEDE

Su OpenWRT/LEDE è sufficiente installare il pacchetto con il comando

opkg update
opkg install oonf-olsrd2

Debian

OLSRv2 non è pacchettizzato per Debian, quindi è necessario compilarlo dai sorgenti. Scaricate l'ultima versione dei sorgenti da: https://github.com/OLSR/OONF Installate le dipendenze:

apt-get update
apt-get install bison flex build-essential cmake libnl-3-dev

Entrate nella directory "build", dentro al codice di OLSRv2 ed eseguite

cmake ..
make
make install

se si vuole usare olsr2_dynamic è necessario esportare il percorso delle librerie:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

E' possibile lanciare olsrd2 con il seguente comando:

/usr/local/sbin/olsrd2_static -l /etc/olsrd2.conf

Configurazione

OpenWRT/LEDE

config olsrv2 'olsrv2'
        list lan '10.150.9.0/24'

config log 'log'
        option file '/var/log/olsrd2.log'

config global 'global'
        option lockfile '/var/lock/olsrd2'
        option pidfile '/var/run/olsrd2.pid'

config interface 'olsr2_common'
        list ifname 'loopback'
        list ifname 'Ant1'
        list ifname 'Ant2'
        list ifname 'Ant3'
        list ifname 'Ant4'

config telnet 'telnet'
        option port '2009'
        option bindto '127.0.0.1'

Debian

Questo è un file di esempio di configurazione: basta sostituire le interfacce con quelle specifiche della vostra configurazione.

[global]
        plugin remotecontrol
        plugin auto_ll4
[telnet]
        bindto  127.0.0.1
        port 2009
        
[olsrv2]
        lan 10.150.x.0/24
                        
[interface=eth1.2]
[interface=eth1.3]
[interface=eth1.4]
[interface=eth1.5]
[interface=lo]

init.d files

/etc/init.d/olsrd2

### BEGIN INIT INFO
# Provides:          olsrd2
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: /etc/init.d/olsrd2: start olsrd2
### END INIT INFO

#               Based on skeleton script written by Miquel van Smoorenburg <miquels@cistron.nl>.
#               Modified for Debian 
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#               Modified for olsrd
#               by Holger Levsen <debian@layer-acht.org>
#               Modified for olsr2
#               by Gabriele Gemmi <gabriel@autistici.org>
# 
# Version:      21-Dec-2006  
# modified:     01-Aug-2007
#               31-Jun-2008
#               30-May-2009

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/olsrd2_static
NAME=olsrd2_static
DESC=olsrd2

PID_FILE=/var/run/$NAME.pid

test -x $DAEMON || exit 0

# Include olsrd defaults if available
if [ -f /etc/default/olsrd2 ] ; then
        . /etc/default/olsrd2
fi

set -e

case "$1" in
  debug)
        echo -n "Starting $DESC: "
        # sleep til olsrd has been started
        while ! pidof $NAME > /dev/null ; do 
          sleep 1
        done
        echo "$NAME."
        echo $(pidof $NAME) > $PID_FILE
        ;;
  start)
        if [ "$START_OLSRD2" != "YES" ] ; then exit 0 ; fi
        if [ "$(pidof $NAME)" != "" ] ; then 
                echo "$NAME already running, doing nothing."
                exit 0
        fi
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PID_FILE -- $DAEMON_OPTS
        # sleep til olsrd has been started
        while ! pidof $NAME > /dev/null ; do 
          sleep 1
        done
        echo "$NAME."        
        echo $(pidof $NAME) > $PID_FILE
        ;;
  stop)
        pidof $NAME || exit 0
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop  --quiet --exec $DAEMON --pidfile $PID_FILE
        rm -f $PID_FILE
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        $0 stop
        sleep 1
        $0 start
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0

/etc/default/olsrd2

# Defaults for olsrd2 initscript
# sourced by /etc/init.d/olsrd2
# installed at /etc/default/olsrd2 by the maintainer scripts

#
# This is a POSIX shell fragment
#

#
# uncomment the next line run olsrd automatically at startup
#
START_OLSRD2="YES"

#
# debuglevel from 1 (=quiet) to 9 (=max debug)
# for running from init.d 0 is recommended
#

#
# "command-line options"
#
DAEMON_OPTS="--set global.fork=true -l /etc/olsrd2.conf"

Ricordate di darei permessi di esecuzione allo script e di farlo partire all'avvio:

chmod +x /etc/init.d/olsrd2
update-rc.d olsrd2 defaults

Management e Troubleshooting

Per controllare lo stato di OONF è possibile usare questi comandi: Visualizzare lo stato delle interfaccie

echo "/nhdpinfo interface" | nc 127.0.0.1 2009

Visualizzare i vicini

echo "/nhdpinfo neighbor" | nc 127.0.0.1 2009

Netjson

echo "/netjsoninfo filter graph ipv4_0" | nc 127.0.0.1 2009