CLI Configuration Guide

FlexSwitch ships with an industry standard CLI that is available for device configuration and management.

Accessing the CLI

To gain access to the CLI, see the Accessing the Command Line Interface page.

Note

The default password for the cli user is snaproute

Upon successful login, this splash screen is presented:

loading schema...
loading model...
 _______  __       __________   ___      _______.____    __    ____  __  .___________.  ______  __    __
|   ____||  |     |   ____\  \ /  /     /       |\   \  /  \  /   / |  | |           | /      ||  |  |  |
|  |__   |  |     |  |__   \  V  /     |   (----` \   \/    \/   /  |  | `---|  |----`|  ,----'|  |__|  |
|   __|  |  |     |   __|   >   <       \   \      \            /   |  |     |  |     |  |     |   __   |
|  |     |  `----.|  |____ /  .  \  .----)   |      \    /\    /    |  |     |  |     |  `----.|  |  |  |
|__|     |_______||_______/__/ \__\ |_______/        \__/  \__/     |__|     |__|      \______||__|  |__|
                                _______  __       __ 
                               /       ||  |     |  |
                              |   ,----||  |     |  |
                              |   |     |  |     |  |
                              |   `----.|  `----.|  |
                               \_______||_______||__|

FlexSwitch Console Version 1.0.0.190, Connected to: localhost Version 1.0.0.195.31
Using snap style cli

localhost>

Privileged Mode

Use the enable command to enter the privileged mode.

localhost>enable
localhost#

Note

The prompt changes from > to # indicatng that the session is in privledged mode.

Configuration Mode

Use the config command to enter into configuration mode:

localhost#config 

*** Configuration will only be applied once 'apply' command is entered ***

localhost(config)#

Built-In Help

The CLI has a help interface with TAB completion and ? suggestions.

Tab Completion

The TAB key can be used as a shortcut for completing individual words in a command or as a way to see available sub-commands in the current context.

Using TAB to complete a word, for example:

When typing show int.

localhost#show int<TAB>

Using TAB at this moment causes the parser to automatically change the command to show interface.

localhost#show interface <TAB>

Using TAB with show interface displays the available options in a brief way without the descriptions given when using ?.

localhost#show interface 
description  fpPort       logical      status       vlan         

TAB completion can be used at each sub-command level to see which options are available.

localhost#show interface fpPort <TAB>
1     13    17    20    24    28    31    35    39    42    46    49s1  5     50s3  51s2  52s1  53    53s4  54s3  8     
10    14    18    21    25    29    32    36    4     43    47    49s2  50    50s4  51s3  52s2  53s1  54    54s4  9     
11    15    19    22    26    3     33    37    40    44    48    49s3  50s1  51    51s4  52s3  53s2  54s1  6     
12    16    2     23    27    30    34    38    41    45    49    49s4  50s2  51s1  52    52s4  53s3  54s2  7     

The end of the sub-command tree is the same as it is with the ?.

localhost#show interface fpPort 1 <TAB>
description  statistics   status       

If there is an overlap between 2 or more words, when using TAB completion each available option will be displayed.

localhost#show interface fpPort 1 stat<TAB>
statistics  status 

In the following example both statistics and status are valid sub-commands for the show interface fpPort 1 command and both start with stat.

Simply inputing an i or a u and then TAB allows the command to auto-complete.

localhost#show interface fpPort 1 stati<TAB>   
localhost#show interface fpPort 1 statistics 
Applying Show:
  RX
    0 unicast packets 0 unicast octets
    0 input discards 0 input errors
    0 unknown protocol 0 runts 0 giants
    0 Fragments 0 CRC 0 jabber
  TX    0 unicast packets 0 unicast octets
    0 output discards 0 output errors
------------------------------------------------------------------------------
sdk:printPortState(fpPort1,) result: SUCCESS

Using the Question Mark

For a list of available commands use the ? at any context:

localhost#?
---------------------------------------------
 Command              Description            
---------------------------------------------
 control:                                    
 context:                                    
   clear     Clear Action Commands  
   config    Configuration Commands 
   reset     Reset Action Commands  
   save      Save Action Commands   
   show      Show Commands          

The example above shows that the available commands at the top-level context are clear, config, reset, save, and show.

Using the ? at the config prompt shows to sets of available commands control and context.

Control Commands

 control:                                                                  
   <cr>                                                           
   apply                                                          
   clearunapplied             Clear the current pending config,   
                                       no argument will clear all, or you  
                                       can delete by cmd index             
   end                        Return to enable mode               
   exit                       Exit current CLI tree position, if  
                                       at base then will exit CLI          
   help                       "Display help for current commands, 
                                       short hand notation of ? can be     
                                       used as well                        
   no                                                             
   ping                       Ping Command                        
   quit                        Quiting FlexSwitch CLI.  This will 
                                       stop the CLI session                
   show                       Show running configuration          
   showunapplied              Display the currently unapplied     
                                       configuration.  An optional 'full'  
                                       argument can be supplied to         
                                               show all objects which are  
                                       pending not just valid provisioning 
                                       objects                             
   where                      Display the current command path    

The control commands shown above are available in all commands and sub-commands in configuration mode.

Context Commands

 context:                                                                  
   acl                        Show acls                           
   aclglobal                  Config AclGlobal Info               
   aclipv4filter              Configure IPv4 filter for acl.      
   aclipv6filter              Configure IPv6 filter for acls.     
   aclmacfilter               Configure MAC filter for acls.      
   arp                        ARP Global Commands                 
   bfd                        BFD Commands                        
   clntIntf                   Commands to configure dwdm module   
                                       client interface                    
   copp                       Control plane policer               
                                       configuration.For supported         
                                       protocols please check default Copp 
                                       config.                             
   dhcp                       DHCP Global Commands                
...

Using the ? on one of the available commands, shows the available sub-commands:

localhost(config)#arp ?
----------------------------------------------------------------------------------------
 Command               Description                                                      
----------------------------------------------------------------------------------------
 control:                                                                               
 context:                                                                               
   timeout    300-1500  Global Arp entry timeout value. Default value default: 
                       600                                                              

This shows that timeout is an available sub-command for arp with a defined range and a short description of the command.

Similar context-based ? results can be seen in the context of show commands:

localhost#show ?
----------------------------------------------------------------------------------------------------------
 Command                              Description                                                         
----------------------------------------------------------------------------------------------------------
 control:                                                                                                 
 context:                                                                                                 
   acl                       Show acls.                                                          
   alarm                     Command to query for all alarms in the system                       
   arp_entry                 Show Arp Entry By IP                                                
   arp_entry_hw              Show HW Arp Entry By IP                                             
   asicglobalpm              Show AsicGlobalPMState Info                                         
...                                     
   interface                 Show All interfaces                                                 

Looking at show interface closer, reveals all of the available sub-commands:

localhost#show interface ?
-----------------------------------------------------------
 Command                   Description                     
-----------------------------------------------------------
 control:                                                  
 context:                                                  
   description    Show All interfaces Description 
   fpPort         Show Port Interface             
   logical        Show Logical Interface          
   status         Show All interfaces brief       
   vlan           Vlan Interface Comamnds     

Using ? after show interface fpPort shows the available options, in this case a list of all front panel ports (fpPorts) on the system:

localhost#show interface vlan ip address
Applying Show:
FAILED TO GET OBJECT for show state: printIPv4Intfs() takes at least 2 arguments (1 given)
localhost#show interface fpPort ?
-------------------------------------------------------------------------------------------
 Command               Description                                                         
-------------------------------------------------------------------------------------------
 control:                                                                                  
 context:                                                                                  
   <value>    1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,2 
                       6,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48 
                       ,49,49s1,49s2,49s3,49s4,50,50s1,50s2,50s3,50s4,51,51s1,51s2,51s3,51 
                       s4,52,52s1,52s2,52s3,52s4,53,53s1,53s2,53s3,53s4,54,54s1,54s2,54s3, 
                       54s4                                                                
                       Front panel port name or system assigned interface id    

Finally, using fpPort 1 as an example, all of the available show interface sub-commands are displayed with an appended ?:

localhost#show interface fpPort 1 ?
---------------------------------------
 Command                   Description 
---------------------------------------
 control:                              
 context:                              
   <cr>                       
   status                     
   description                
   statistics                 

Pressing Enter after show interface fpPort 1 returns a summary view of the information available for fpPort 1. More specific information can be obtained using the status, description, or statistics sub-commands.

localhost#show interface fpPort 1
Applying Show:
fpPort1 is DOWN Admin State is DOWN
  PresentInHW: YES
  Config Mode: Unconfigured
  PhyType: MII, Media Type Media Type, Address cc:37:ab:f3:66:29
  MTU 9416 Bytes  Full_Duplex, 0 Mb/s  Breakout Status: unsupported
  Last link down: 
  Last link up: 
  Number of Link flaps: 0
  ErrDisableReason: 
  RX
    0 unicast packets 0 unicast octets
    0 input discards 0 input errors
    0 unknown protocol 0 runts 0 giants
    0 Fragments 0 CRC 0 jabber
  TX    0 unicast packets 0 unicast octets
    0 output discards 0 output errors
------------------------------------------------------------------------------
sdk:printPortState(fpPort1,) result: SUCCESS

localhost#show interface fpPort 1 status
Applying Show:
 Port       Description    Status    Mtu            Duplex    Speed    AutoNeg    Type 
---------------------------------------------------------------------------------------
 fpPort1                   DOWN      Full_Duplex    9416      0        ON         MII  
------------------------------------------------------------------------------
sdk:printPortState(fpPort1,) result: SUCCESS