How to use DES-SERT based Daemons
[Manual]

This module provides information on how to use DES-SERT based Daemons. More...

Collaboration diagram for How to use DES-SERT based Daemons:

This module provides information on how to use DES-SERT based Daemons.

Configuration Files

DES-SERT should normally provide the following configuration files:

Both files are merged when using the provided init script.

Protocol Configuration

Protocol specific configuration shall only be placed in the /etc/DAEMON_NAME.conf file. Each line should be valid CLI syntax and, besides some CLI commands provided by DES-SERT, all commands should be parsed by user provided CLI callbacks.

Example file:

  no logging stderr
  logging ringbuffer 20
  logging file /var/log/des-gossip.log
  set threshold 0.3
  set metric etx

Daemon Configuration

All values that are used by DES-SERT based daemons and that are protocol unspecific are placed in /etc/default/DAEMON_NAME. Currently, the configuration of the interfaces, TCP port of the CLI, and PID file are supported parameters.

Example file:

   PIDFILE="/var/run/des-gossip.pid"
   DAEMON_OPTS="/etc/des-gossip.conf"
   TAP_NAME=tap0
   TAP_IP=10.0.0.1
   TAP_NETMASK=255.255.255.0
   CLI_PORT=4519
   IFACE=eth0

Init Script

DES-SERT daemons should provide an init script to start and stop the daemon. The example script provided in the des-example package additionally provides merging of both configurations files. The result is placed in /tmp/DAEMON_NAME.cli and contains the original content of the protocol configuration file and interface configuration in the CLI syntax that has been compiled from the daemon configuration file.

Debian Package Auto-Configuration

We also provide sample files to create a Debian package from DES-SERT daemons that are available as source code release. A debconf script asks the user during the installation (or reconfiguration) of the particular Debian package for all the information that is contained in /etc/default/DAEMON_NAME.

You should not add new parameters to the daemon configuration file or modify the init script if you want to make use of updated versions of des-example.

Accessing the CLI

You can use a telnet program or similar applications and libraries to get access to the CLI. The default TCP port is 4519 (4=D, 5=E, 19=S). The "help" command lists all commands that are available in the current mode and you can push TAB for auto-completion.

  user@host:~$ telnet localhost 4519
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  
  host:XYZ> help
  
  Commands available:
  help                 Show available commands
  quit                 Disconnect
  logout               Disconnect
  exit                 Exit from current mode
  history              Show a list of previously run commands
  enable               Turn on privileged commands
  show dessert-info    Display information about this program.
  show logging         show logging ringbuffer
  show meshifs         Print list of registered interfaces used by the daemon.
  show sysif           Print the name of the TUN/TAP interface used as system interface.
  show threshold       show treshold
  
  host:XYZ>

XYZ is the name of the particular daemon.

For in-detail information how the CLI is used, have a look at the libcli Wiki.

Troubleshooting

In some scenarios, telnet cannot connect to the configured TCP port of the CLI.

  user@host:~$ telnet localhost 4519                                           
  Trying 127.0.0.1...                                                                                                                   
  telnet: Unable to connect to remote host: Connection refused   

Have a look at the log file and chech if the daemon is running. If everything seems to be right, the problem might be due to some misconfiguration. In newer Linux distribution the bind syscall of the daemon with the parameters AF_INET6 and SOCK_STREAM will result only in binding to a IPv6 socket. You can either replace "localhost" by "::1" for the address parameter of telnet or change the kernel setting with sysctl.

  user@host:~$ telnet ::1 4519
  user@host:~$ sysctl -w net.ipv6.bindv6only=0

The configuration can be set at boot time when configured in /etc/sysctl.conf.