Indigo Initialization and Configuration

Table of Contents

Overview

This document provides a description of Indigo configuration and initialization. It also is intended to be the definitive list for Indigo configuration variables.

Update for 2012.03.19

Please see March 2012 Indigo Initialization for updates to the network configuration added to the 2012.03.19 release.

Quick Start: "How do I" Questions

How do I configure out-of-band networking?

Make sure the file /etc/oob-network exists. It will be executed early in the init process. For Pronto systems this file normally exists and just runs ifcfg.sh for eth0 and eth1. See below about adding your own version of the file.

How do I configure in-band networking?

Make sure the file /etc/inband-network exists. It will be executed after oswd is running to ensure tap0, the dataplane interface, exists. For Pronto systems this file normally exists and just runs ifcfg.sh for tap0. See below about adding your own version of the file.

How do I get my own version of the file /somedir/somefile integrated into the configuration?

The easiest way is to use the overlay mechanism. Log in to the Linux shell. Put the file where you want it (using tftp or just 'cat > somefile' and paste in the contents) and run:

cd /somedir
ovladd somefile
ovlshow
ovlsave

There after, the file should be overlaid on the root FS at each boot up.

How do I back up my configuration?

The easiest way is to archive /local and tftp it to a server:

cd /
tar czf local.tgz local
tftp -l local.tgz -p <tftp-ip-addr>

This will save all your logs as well. You can clear those out first if you don't want them.

How do I clear all non-default configuration?

Recommendation: Back up your configuration using the above recommendation. In addition, you should probably copy /local/sysenv (or /local/sfs/sysenv) to /tmp so you can use it to recreate your configuration variables.

The easiest way is to wipe out /local. But you may want to be more selective. In particular, wiping /local/logs on a running system may cause problems.

On systems with a CF card (3290 and 3780):

cd /local
ls
 ==> cfg_history        indigo-preinit.sh  overlay            sysenv
 ==> config.bcm         logs               rc.soc
rm -rf indigo-preinit.sh overlay sysenv rc.soc config.bcm

For systems with sfs (Netgear and the 3240) you'll also need to clear the SFS file system in flash by recreating it with an empty SFS directory:

cd /local
ls
 ==> config.bcm  logs        rc.soc      sfs
rm -rf sfs rc.soc config.bcm
mkdir sfs
sfs_create

You may now want to go into the CLI or web uI to recreate the sysenv file again by editing your configuration and saving it. Alternatively you can directly edit a saved copy.

How do I get my own script to run early in the init process?

If the file indigo-preinit.sh is found in the system's "config" directory, it is executed before starting the system_init script. The "config" directory is /local on platforms with a CF card (Pronto 3290 and 3780) and /local/sfs on others (Netgear and Pronto 3240 systems).

How do I get my own script to run late in the init process?

As above, but the filename is indigo-postinit.sh. It is executed at the end the system_init script.

How do I configure VLANs on the switch?

Currently this is not supported explicitly through the UI. Custom scripts can be generated that will configure VLANs using ASIC driver specific commands. Please send a question to the Indigo Forums at http://forums.openflowhub.org/forumdisplay.php?5-Indigo for more information.

High Level Initialization Sequence

Note that the information in this section applies to Indigo releases prior to the 2012.03.19 release.
For 2012.03.19 and after, please see March 2012 Indigo Initialization.

  • The platform specific init script is executed.
    • /etc/rc.sh on Pronto platforms
    • /etc/preinit, then /etc/init.d/rcS on GSM73xxSO platforms
    • Installs drivers for HW platform
    • Must point the variable config_dir to the persistent configuration directory
      • /local/sfs on GSM73xxSO and Pronto 3240 platforms
      • /local on other Pronto platforms
    • Sources indigo-preinit.sh if found
  • find-env is sourced to set environment variables. These determine what gets executed next.
    • Look for the following files in $config_dir; if not found, use those in /etc.
      • system_init: Executed at the end of platform init script
      • system_config: Executed at the end of system init to bring up OpenFlow
      • rc.soc: Initialization script for BCM driver
      • config.bcm: Configuration file for BCM driver
      • sysenv: Sourced by find-env. May set any of the variables listed below.
  • Run system_init
    • Copy persistent overlay directory to root FS
    • Configure out-of-band network if the script /etc/oob-network is found
    • Switch daemon config and restart mechanism invoked
      • ofswd-setup: Sets up init scripts and calls ofswd-exec in background
      • ofswd-exec: Runs ofswd in foreground; if exits, calls ofswd-setup again
    • Sources indigo-postinit.sh if found

Using the Overlay Commands

This section needs to be completed.

The overlay utilities save files in the persistent memory of the switch and writes them into the filesystem during initialization. The original files are saved in a backup directory which is normally /local/overlay-backup.

ovladd <filename>

Add a file to be saved in the overlay system. DOES NOT copy the file to the overlay. Use ovlsave to make that happen.

ovlsave

Copy the files listed in the overlay list into the persistent overlay location and save the result.

ovlremove <filename>

Remove a file from the overlay list. DOES NOT actually update the overlay. Use ovlsave to make that happen.

ovlrestore <filename>

Copy the original file from the backup back to its location in the file system.

ovlshow

Display the files currently configured to be saved in the overlay. It does not show what's actually saved.

Network Configuration

Indigo recognizes the network interfaces eth0, eth1 and tap0. eth0 and eth1 are out-of-band interfaces (NICs directly attached to the switch CPU) and are not available on the GSM73xxSO platforms. tap0 is the dataplane interface and is used for in-band management. Configuration files for each interface may exist in /etc under the filename ifcfg-eth0, ifcfg-eth1 and ifcfg-tap0 respectively. If present, the file is sourced when configuring the interface. Normally these files are saved in the overlay.

The initialization script will check for ifcfg-* files in the persistent configuration (sfs, etc) and copy them into /etc if present.

The following are interface specific variables that may be specified in each configuration file.

Name

Valid Values

Test Used

Notes

ip_addr

Dotted IP

N/A

The IP address to use for the interface if statically configured

netmask

Dotted IP

N/A

The netmask to use if statically configured

gateway

Dotted IP

N/A

The address of the gateway to add if set

dhcp_config

enable, disable, require

see notes

If != "require", configure IP address with static value.
Then, if != "disable", run DHCP client on the interface.

use_factory_mac

yes, no

!= "no"

GSM73xx only. Applies only to tap0

mac_addr

Colon separated MAC

N/A

GSM73xxSO only. MAC address to use for tap0
if use_factory_mac is not set.

OpenFlow Configuration Variables

Name

Valid Values

Test Used

Notes

datapath_id

up to 16 hex digits

N/A

 

fail_mode

open, closed

N/A

Passed to ofprotocol

controller_ip

Dotted IP

N/A

 

controller_port

decimal integer

N/A

L4 port number for contacting controller

tap0_mac

Colon separated MAC

N/A

MAC address to use for tap0.

dp_mgmt

yes, no

== "yes"

Enable management through the dataplane

dp_mgmt_oob

yes, no

== "yes"

If defined, use dedicated port or VLAN for controller connection.
At least one of dp_mgmt_port or dp_mgmt_vlan must be defined.
Implies dp_mgmt == yes

dp_mgmt_port

decimal integer

N/A

OpenFlow port number to use for controller
connection if dp_mgmt_port_fixed is yes.

dp_mgmt_port_fixed

yes, no

== "yes"

OpenFlow port number to use for controller
connection. Implies dp_mgmt == yes

dp_mgmt_vid

0 - 4095

N/A

Not supported as of 8/2011. VLAN ID to use for controller traffic if
dp_mgmt_vid_fixed is yes.

dp_mgmt_vid_fixed

yes, no

== "yes"

Not supported as of 8/2011. VLAN ID to use for controller traffic.
Implies dp_mgmt == yes

ofp_options

string

N/A

Must be valid argument passed to ofprotocol.

configure_inband

yes, no

== "yes"

If "yes" then configure the tap0 interface.
If dp_mgmt is enabled, use switch_ip

Initialization Feature Configuration

Name

Valid Values

Test Used

Notes

disable_httpd

yes, no

!= "yes"

If "yes", do not enable web server

disable_telnetd

yes, no

!= "yes"

If "yes", do not enable telnet server

disable_sshd

yes, no

!= "yes"

If "yes", do not enable ssh daemon

disable_overlay

yes, no

!= "yes"

If "yes", do not enable unpack overlay directory

log_level

none, error, warn, info, verbose, vverb

N/A

Logging level for driver

Interface Configuration Variables

The following variables affect how some things look in the interface. None of them are critical to the behavior of the switch.

Name

Valid Values

Test Used

Notes

system_ref

string

N/A

AKA switch_ref

hostname

string

N/A

If defined, used as hostname; else use system_ref

PS1

string

N/A

The usual prompt for bash-like shells; set to system_ref if not defined

Core System Configuration

The following table shows configuration variables that affect how things work. In general, these should not be modified.

Name

Valid Values

Test Used

Notes

client_root

string

N/A

Top level directory where driver execution occurs. Normally /local

config_dir

string

N/A

Location of system configuration directory.
Normally /local or /local/sfs.

disable_sysconf

yes, no

== "yes"

If "yes", run init, but not system config.
Core OpenFlow driver is not started.

platform

p3240, p3290, p3780, gsm73xxso

Various

Indicates the platform. Must be defined in
/etc/platform.sh and should not be defined elsewhere

Other notes

The file sysenv is where config variables are defined. It should only have export commands with the variables above (although no checking of that is done).

The CLI uses the table keywords.config in usr/local/switch_cli/key_action.lua to determine what are legal config params. (Known issues with string parameters in the UI here).

The file usr/local/lib/lua/5.1/ui_config.lua has the validators that are applied to config variables when being written out by UI components.

There is an attempt to keep all data orthogonal and avoid things like interpreting the absence of a variable as meaning something special.