Preface
Copyrights and Trademarks
© 2024 IP Infusion Inc. All Rights Reserved.
This documentation is subject to change without notice. The software described in this document and this documentation are furnished under a license agreement or nondisclosure agreement. The software and documentation may be used or copied only in accordance with the terms of the applicable agreement. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or any means electronic or mechanical, including photocopying and recording for any purpose other than the purchaser's internal use without the written permission of IP Infusion Inc.
IP Infusion Inc.
3965 Freedom Circle, Suite 200
Santa Clara, CA 95054
+1 408-400-1900
For support, questions, or comments via E-mail, contact:
Trademarks:
IP Infusion and OcNOS are trademarks or registered trademarks of IP Infusion. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Use of certain software included in this equipment is subject to the IP Infusion, Inc. End User License Agreement at http://www.ipinfusion.com/license. By using the equipment, you accept the terms of the End User License Agreement.
About this Guide
This guide describes how to configure OcNOS.
Audience
This guide is intended for network administrators and other engineering professionals who configure OcNOS.
Conventions
Table 1 shows the conventions used in this guide.
Table 1: Conventions
Convention | Description |
---|
Italics | Emphasized terms; titles of books |
Note: | Special instructions, suggestions, or warnings |
monospaced type | Code elements such as commands, parameters, files, and directories |
Chapter Organization
The chapters in command references are organized as described in
Command Description Format.
The chapters in configuration guides are organized into these major sections:
• An overview that explains a configuration in words
• Topology with a diagram that shows the devices and connections used in the configuration
• Configuration steps in a table for each device where the left-hand side shows the commands you enter and the right-hand side explains the actions that the commands perform
• Validation which shows commands and their output that verify the configuration
Related Documentation
For information about installing OcNOS, see the Installation Guide for your platform.
Feature Availability
The features described in this document that are available depend upon the OcNOS SKU that you purchased. See the Feature Matrix for a description of the OcNOS SKUs.
Migration Guide
Check the Migration Guide for configuration changes to make when migrating from one version of OcNOS to another.
Support
For support-related questions, contact support@ipinfusion.com.
Comments
If you have comments, or need to report a problem with the content, contact techpubs@ipinfusion.com.
Command Line Interface
This chapter introduces the OcNOS Command Line Interface (CLI) and how to use its features.
You use the CLI to configure, monitor, and maintain OcNOS devices. The CLI is text-based and each command is usually associated with a specific task.
You can give the commands described in this manual locally from the console of a device running OcNOS or remotely from a terminal emulator such as putty or xterm. You can also use the commands in scripts to automate configuration tasks.
Command Line Interface Help
You access the CLI help by entering a full or partial command string and a question mark “?”. The CLI displays the command keywords or parameters along with a short description. For example, at the CLI command prompt, type:
> show ?
The CLI displays this keyword list with short descriptions for each keyword:
show ?
application-priority Application Priority
arp Internet Protocol (IP)
bfd Bidirectional Forwarding Detection (BFD)
bgp Border Gateway Protocol (BGP)
bi-lsp Bi-directional lsp status and configuration
bridge Bridge group commands
ce-vlan COS Preservation for Customer Edge VLAN
class-map Class map entry
cli Show CLI tree of current mode
clns Connectionless-Mode Network Service (CLNS)
control-adjacency Control Adjacency status and configuration
control-channel Control Channel status and configuration
cspf CSPF Information
customer Display Customer spanning-tree
cvlan Display CVLAN information
debugging Debugging functions (see also 'undebug')
etherchannel LACP etherchannel
ethernet Layer-2
...
If you type the ? in the middle of a keyword, the CLI displays help for that keyword only.
> show de?
debugging Debugging functions (see also 'undebug')
If you type the ? in the middle of a keyword, but the incomplete keyword matches several other keywords, OcNOS displays help for all matching keywords.
> show i? (CLI does not display the question mark).
interface Interface status and configuration
ip IP information
isis ISIS information
Command Completion
The CLI can complete the spelling of a command or a parameter. Begin typing the command or parameter and then press the tab key. For example, at the CLI command prompt type sh:
> sh
Press the tab key. The CLI displays:
> show
If the spelling of a command or parameter is ambiguous, the CLI displays the choices that match the abbreviation. Type show i and press the tab key. The CLI displays:
> show i
interface ip ipv6 isis
> show i
The CLI displays the interface and ip keywords. Type n to select interface and press the tab key. The CLI displays:
> show in
> show interface
Type ? and the CLI displays the list of parameters for the show interface command.
> show interface
IFNAME Interface name
| Output modifiers
> Output redirection
<cr>
The CLI displays the only parameter associated with this command, the IFNAME parameter.
Command Abbreviations
The CLI accepts abbreviations that uniquely identify a keyword in commands. For example:
> sh int xe0
is an abbreviation for:
> show interface xe0
Command Line Errors
Any unknown spelling causes the CLI to display the error Unrecognized command in response to the ?. The CLI displays the command again as last entered.
> show dd?
% Unrecognized command
> show dd
When you press the Enter key after typing an invalid command, the CLI displays:
(config)#router ospf here
^
% Invalid input detected at '^' marker.
where the ^ points to the first character in error in the command.
If a command is incomplete, the CLI displays the following message:
> show
% Incomplete command.
Some commands are too long for the display line and can wrap mid-parameter or mid-keyword, as shown below. This does not cause an error and the command performs as expected:
area 10.10.0.18 virtual-link 10.10.0.19 authent
ication-key 57393
Command Negation
Many commands have a no form that resets a feature to its default value or disables the feature. For example:
• The ip address command assigns an IPv4 address to an interface
• The no ip address command removes an IPv4 address from an interface
Syntax Conventions
Table 2 describes the conventions used to represent command syntax in this reference.
Table 2: Syntax conventions
Convention | Description | Example |
---|
monospaced font | Command strings entered on a command line | show ip ospf |
lowercase | Keywords that you enter exactly as shown in the command syntax. | show ip ospf |
UPPERCASE | | IFNAME |
() | Optional parameters, from which you must select one. Vertical bars delimit the selections. Do not enter the parentheses or vertical bars as part of the command. | (A.B.C.D|<0-4294967295>) |
() | Optional parameters, from which you select one or none. Vertical bars delimit the selections. Do not enter the parentheses or vertical bars as part of the command. | (A.B.C.D|<0-4294967295>|) |
() | Optional parameter which you can specify or omit. Do not enter the parentheses or vertical bar as part of the command. | (IFNAME|) |
{} | Optional parameters, from which you must select one or more. Vertical bars delimit the selections. Do not enter the braces or vertical bars as part of the command. | {intra-area <1-255>|inter-area <1-255>|external <1-255>} |
[] | Optional parameters, from which you select zero or more. Vertical bars delimit the selections. Do not enter the brackets or vertical bars as part of the command. | [<1-65535>|AA:NN|internet|local-AS| no-advertise|no-export] |
? | Nonrepeatable parameter. The parameter that follows a question mark can only appear once in a command string. Do not enter the question mark as part of the command. | ?route-map WORD |
. | Repeatable parameter. The parameter that follows a period can be repeated more than once. Do not enter the period as part of the command. | set as-path prepend .<1-65535> |
Variable Placeholders
Table 3 shows the tokens used in command syntax use to represent variables for which you supply a value.
Table 3: Variable placeholders
Token | Description |
---|
WORD | A contiguous text string (excluding spaces) |
LINE | A text string, including spaces; no other parameters can follow this parameter |
IFNAME | Interface name whose format varies depending on the platform; examples are: eth0, Ethernet0, ethernet0, xe0 |
A.B.C.D | IPv4 address |
A.B.C.D/M | IPv4 address and mask/prefix |
X:X::X:X | IPv6 address |
X:X::X:X/M | IPv6 address and mask/prefix |
HH:MM:SS | Time format |
AA:NN | BGP community value |
XX:XX:XX:XX:XX:XX | MAC address |
<1-5> <1-65535> <0-2147483647> <0-4294967295> | Numeric range |
Command Description Format
Table 4 explains the sections used to describe each command in this reference.
Table 4: Command descriptions
Section | Description |
---|
Command Name | The name of the command, followed by what the command does and when should it be used |
Command Syntax | The syntax of the command |
Parameters | Parameters and options for the command |
Default | The state before the command is executed |
Command Mode | The mode in which the command runs; see Command Modes |
Example | An example of the command being executed |
Keyboard Operations
Table 5 lists the operations you can perform from the keyboard.
Table 5: Keyboard operations
Key combination | Operation |
---|
Left arrow or Ctrl+b | Moves one character to the left. When a command extends beyond a single line, you can press left arrow or Ctrl+b repeatedly to scroll toward the beginning of the line, or you can press Ctrl+a to go directly to the beginning of the line. |
Right arrow or Ctrl-f | Moves one character to the right. When a command extends beyond a single line, you can press right arrow or Ctrl+f repeatedly to scroll toward the end of the line, or you can press Ctrl+e to go directly to the end of the line. |
Esc, b | Moves back one word |
Esc, f | Moves forward one word |
Ctrl+e | Moves to end of the line |
Ctrl+a | Moves to the beginning of the line |
Ctrl+u | Deletes the line |
Ctrl+w | Deletes from the cursor to the previous whitespace |
Alt+d | Deletes the current word |
Ctrl+k | Deletes from the cursor to the end of line |
Ctrl+y | Pastes text previously deleted with Ctrl+k, Alt+d, Ctrl+w, or Ctrl+u at the cursor |
Ctrl+t | Transposes the current character with the previous character |
Ctrl+c | Ignores the current line and redisplays the command prompt |
Ctrl+z | Ends configuration mode and returns to exec mode |
Ctrl+l | Clears the screen |
Up Arrow or Ctrl+p | Scroll backward through command history |
Down Arrow or Ctrl+n | Scroll forward through command history |
Show Command Modifiers
You can use two tokens to modify the output of a show command. Enter a question mark to display these tokens:
# show users ?
| Output modifiers
> Output redirection
You can type the | (vertical bar character) to use output modifiers. For example:
> show rsvp | ?
begin Begin with the line that matches
exclude Exclude lines that match
include Include lines that match
last Last few lines
redirect Redirect output
Begin Modifier
The begin modifier displays the output beginning with the first line that contains the input string (everything typed after the begin keyword). For example:
# show running-config | begin xe1
...skipping
interface xe1
ipv6 address fe80::204:75ff:fee6:5393/64
!
interface xe2
ipv6 address fe80::20d:56ff:fe96:725a/64
!
line con 0
login
!
end
You can specify a regular expression after the begin keyword, This example begins the output at a line with either “xe2” or “xe4”:
# show running-config | begin xe[3-4]
...skipping
interface xe3
shutdown
!
interface xe4
shutdown
!
interface svlan0.1
no shutdown
!
route-map myroute permit 3
!
route-map mymap1 permit 10
!
route-map rmap1 permit 3
!
line con 0
login
line vty 0 4
login
!
end
Include Modifier
The include modifier includes only those lines of output that contain the input string. In the output below, all lines containing the word “input” are included:
# show interface xe1 | include input
input packets 80434552, bytes 2147483647, dropped 0, multicast packets 0
input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 1, missed 0
You can specify a regular expression after the include keyword. This examples includes all lines with “input” or “output”:
#show interface xe0 | include (in|out)put
input packets 597058, bytes 338081476, dropped 0, multicast packets 0
input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0
output packets 613147, bytes 126055987, dropped 0
output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0
Exclude Modifier
The exclude modifier excludes all lines of output that contain the input string. In the following output example, all lines containing the word “input” are excluded:
# show interface xe1 | exclude input
Interface xe1
Scope: both
Hardware is Ethernet, address is 0004.75e6.5393
index 3 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>
VRF Binding: Not bound
Administrative Group(s): None
DSTE Bandwidth Constraint Mode is MAM
inet6 fe80::204:75ff:fee6:5393/64
output packets 4438, bytes 394940, dropped 0
output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0
collisions 0
You can specify a regular expression after the exclude keyword. This example excludes lines with “output” or “input”:
# show interface xe0 | exclude (in|out)put
Interface xe0
Scope: both
Hardware is Ethernet Current HW addr: 001b.2139.6c4a
Physical:001b.2139.6c4a Logical:(not set)
index 2 metric 1 mtu 1500 duplex-full arp ageing timeout 3000
<UP,BROADCAST,RUNNING,MULTICAST>
VRF Binding: Not bound
Bandwidth 100m
DHCP client is disabled.
inet 10.1.2.173/24 broadcast 10.1.2.255
VRRP Master of : VRRP is not configured on this interface.
inet6 fe80::21b:21ff:fe39:6c4a/64
collisions 0
Redirect Modifier
The redirect modifier writes the output into a file. The output is not displayed.
# show cli history | redirect /var/frame.txt
The output redirection token (>) does the same thing:
# show cli history >/var/frame.txt
Last Modifier
The last modifier displays the output of last few number of lines (As per the user input). The last number ranges from 1 to 9999.
For example:
#show running-config | last 10
String Parameters
The restrictions in
Table 6 apply for all string parameters used in OcNOS commands, unless some other restrictions are noted for a particular command.
Table 6: String parameter restrictions
Restriction | Description |
---|
Input length | 1965 characters or less |
Restricted special characters | “?”, “,”, “>”, “|”, and “=” The “|” character is allowed only for the description command in interface mode. |
Command Modes
Commands are grouped into modes arranged in a hierarchy. Each mode has its own set of commands.
Table 7 lists the command modes common to all protocols.
Table 7: Common command modes
Name | Description |
---|
Executive mode | Also called view mode, this is the first mode to appear after you start the CLI. It is a base mode from where you can perform basic commands such as show, exit, quit, help, and enable. |
Privileged executive mode | Also called enable mode, in this mode you can run additional basic commands such as debug, write, and show. |
Configure mode | Also called configure terminal mode, in this mode you can run configuration commands and go into other modes such as interface, router, route map, key chain, and address family. Configure mode is single user. Only one user at a time can be in configure mode. |
Interface mode | In this mode you can configure protocol-specific settings for a particular interface. Any setting you configure in this mode overrides a setting configured in router mode. |
Router mode | This mode is used to configure router-specific settings for a protocol such as BGP or OSPF. |
Command Mode Tree
The diagram below shows the common command mode hierarchy.
Common command modes
To change modes:
1. Enter privileged executive mode by entering enable in Executive mode.
2. Enter configure mode by entering configure terminal in Privileged Executive mode.
The example below shows moving from executive mode to privileged executive mode to configure mode and finally to router mode:
> enable mypassword
# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
(config)# router ospf
(config-router)#
Note: Each protocol can have modes in addition to the common command modes. See the command reference for the respective protocol for details.
Transaction-based Command-line Interface
The command line interface is transaction based:
• Any changes done in configure mode are stored in a separate
candidate configuration that you can view with the
show transaction current command.
• When a configuration is complete, apply the candidate configuration to the running configuration with the
commit command.
• If a
commit fails, no configuration is applied as the entire transaction is considered failed. You can continue to change the candidate configuration and then retry the
commit.
• Multiple configurations cannot be removed with a single
commit. You must remove each configuration followed by a
commit.
Note: All commands MUST be executed only in the default CML shell (cmlsh). If you log in as root and start imish, then the system configurations will go out of sync. The imish shell is not supported and should not be started manually.