Indigo - OpenFlow for Hardware Switches
Table of Contents
This is a place to accumulate information about the Indigo CLI. It needs to be worked in to a full reference manual
The help command in the CLI provides the most up to date information for the version of software running on the switch.
The CLI is normally invoked interactively with the command cli
. A single CLI command may be run with the cmd
command. This is useful as you can use shell pipes. For example:
cmd flowtable | grep 192.168.1.150 |
A file of CLI commands can be executed with cmd -f <filename>
.
The command line options below require the CLI be invoked from the switch_cli directory.
The commands -e
, -f
and -b
are non-interactive commands.
Option |
Explanation |
Arguments |
Example |
Notes |
|
---|---|---|---|---|---|
-d |
Set debug level |
String |
|
Options include verbose, vverb, info, warn, error and none; may be abbreviated |
|
-m |
Set max port number |
Integer |
|
Used mostly for debugging |
|
-e |
Run a command from the command line and exit |
String command |
|
Quotes are required around the command |
|
-f |
Run commands from a file |
String filename |
|
Reads and executes commands in script in non-interactive mode |
|
-b |
Run in non-interactively (batch mode) |
N/A |
|
Turns off inline help, command completion, etc |
In general, commands can be edited while being entered with arrow or special command keys. Command completion is done with the 'tab' key. Currently command completion The following keys provide editing functions.
Command history is supported up to 100 lines. Empty lines and repeated lines are not stored in history.
key |
function |
---|---|
control-a |
goto beginning of line |
control-c |
Terminate CLI with error code |
control-d |
Quit CLI normally. Only when cursor is at the start of the line |
control-e |
goto end of line |
control-h |
delete previous character |
control-k |
kill to end of line |
control-u |
kill line |
delete |
delete previous character |
left-arrow |
move cursor left one character |
right-arrow |
move cursor right one character |
up-arrow |
replace line with next older command from history |
down-arrow |
replace line with next newer command from history |
command |
brief description |
---|---|
cli_stat |
Show debug information about CLI |
config |
Show/modify running or saved configuration |
cxn_history |
Show controller connection history |
debug |
Set debug level: error, warn, info, verbose, vverb |
drvcmd |
Run an switch hardware driver command |
echo |
Echo request to command server |
enable |
Enter the 'enable' mode (currently no effect on UI) |
flowtable |
Show the flowtable: brief, extended, full |
help |
Show help for commands |
history |
Show command history |
lua |
Evaluate a lua expression |
mgmtstats |
Show management statistics |
port |
Show/set/stats for ports; use -l to indicate only ports with link (show,stats) |
ps |
Show port info; use -l to indicate only ports with link |
quit |
Quit the CLI (if supported) |
shell |
Run a shell command |
status |
Show switch status |
version |
Show firmware version |
There are two types of command line parameters:
Positional parameters determine their meaning from their position (first parameter means...) Keyword parameters are usually of the form "keyword=value". Some keyword parameters may not take a value and thus are considered "flags". They typically start with a hyphen, -.
Positional parameters must precede keyword parameters. Positional parameters are ended by:
SwitchCLI# port set 3 speed=1000 mtu-1600 |
SwitchCLI# port show 1-10 -l |
SwitchCLI# ps -l |
No parameters
The config command is the primary mechanism for updating the values that determine the initialization sequence of the system. There are a set of known configuration keywords that are documented in the Indigo Initialization and Configuration document. Additional keywords may be added which can be referenced in user generated scripts which source either /etc/find-env or the appropriate sysenv file.
config <sub-command> [<variable> [<value>] ] |
command |
notes |
---|---|
config show |
Show all variables in saved config |
config show dp_mgmt |
Show the value of avar in saved config |
config running |
Show all variables in running config |
config set dp_mgmt yes |
Set dp_mgmt to yes in saved config |
config delete dp_mgmt |
Delete dp_mgmt from saved config |
parameter |
notes |
---|---|
1 (Positional) |
Subcommand: show, set, running, delete |
2 (Positional) |
Variable to show, set or delete |
Rest of line |
For 'set', the rest of the line gives the value to use. |
parameter |
notes |
---|---|
1 (Positional) |
Debug level |
Note that as of 8/2011, this has no effect (always in enable mode).
parameter |
notes |
---|---|
1 (Positional) |
brief, extended or full: How much info to show |
command |
notes |
---|---|
help |
List command names and brief description |
help <command> |
Show help for command with parameter help |
help all |
Show all help for all commands with parameter help |
port <subcmd> <p-spec> [<set keyword options>] |
command |
notes |
---|---|
port show * |
Show port attributes |
port show * -l |
Show attributes of all ports with link |
port set 2-4,8,12 speed=1000 |
Set port attributes |
port stats 8,9,15 |
Show port statistics |
parameter |
notes |
---|---|
1 (Positional) |
Subcommand: show, set or stats |
2 (Positional) |
Port list like * or 1,2,4-8 |
-l (the letter L) |
For show and stats, show only ports with link |
autoneg |
Enable autoneg, yes or no |
duplex |
full duplex enabled |
enable |
Port enable state |
mtu |
MTU of port in bytes |
rx_pause |
rx_pause enabled |
speed |
Port speed in Mb |
tx_pause |
tx_pause enabled |
parameter |
notes |
---|---|
1 (Positional) |
Port list like * or 1,2,4-8 |
-l (the letter L) |
Show only ports with link |