5. Using the CLI. Alcatel-Lucent OmniSwitch 6800 Series, OmniSwitch 9000 Series, OmniSwitch 6850 Series

Add to My manuals
292 Pages

advertisement

5. Using the CLI. Alcatel-Lucent OmniSwitch 6800 Series, OmniSwitch 9000 Series, OmniSwitch 6850 Series | Manualzz

5 Using the CLI

Alcatel-Lucent’s Command Line Interface (CLI) is a text-based configuration interface that allows you to configure switch applications and to view switch statistics. Each CLI command applicable to the switch is defined in the OmniSwitch CLI Reference Guide. All command descriptions listed in the Reference Guide include command syntax definitions, defaults, usage guidelines, example screen output, and release history.

This chapter describes various rules and techniques that will help you use the CLI to its best advantage.

This chapter includes the following sections:

“CLI Overview” on page 5-2

“Command Entry Rules and Syntax” on page 5-3

“CLI Services” on page 5-9

“Logging CLI Commands and Entry Results” on page 5-15

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-1

CLI Specifications Using the CLI

CLI Specifications

The following table lists specifications for the Command Line Interface.

Configuration Methods

Command Capture Feature

User Service Features

Online configuration via real-time sessions using CLI commands.

Offline configuration using text file holding CLI commands.

Snapshot feature captures switch configurations in a text file.

Command Line Editing

Command Prefix Recognition

CLI Prompt Option

Command Help

Keyword Completion

Command History (up to 30 commands)

Command Logging (up to 100 commands; detailed information)

Syntax Error Display

Alias Command Option

More Command

CLI Overview

The CLI uses single-line text commands that are similar to other industry standard switch interfaces.

However, the Alcatel-Lucent CLI is different from industry standard interfaces in that the Alcatel-Lucent uses a single level command hierarchy.

Unlike other switch interfaces, the Alcatel-Lucent CLI has no concept of command modes. Other CLIs require you to step your way down a tree-type hierarchy to access commands. Once you enter a command mode, you must step your way back to the top of the hierarchy before you can enter a command in a different mode. The Alcatel-Lucent switch will answer any CLI command at any time because there is no hierarchy.

Online Configuration

To configure parameters and view statistics you must connect the switch to a terminal, such as a PC or

UNIX workstation, using terminal emulation software. This connection can be made directly to the switch’s serial port, through a modem, or over a network via Telnet. For information about connecting a terminal to the switch, see the appropriate Getting Started Guide.

Note. If you are using an OmniSwitch 6800 or an OmniSwitch 6850 switch in a stacked configuration, you must be connected to the console port of the primary switch. For detailed information on primary switch status, refer to the “Managing Stacks” chapter in the appropriate Hardware Users Guide.

Once you are logged in to the switch, you may configure the switch directly using CLI commands.

Commands executed in this manner normally take effect immediately. The majority of CLI commands are independent, single-line commands and therefore can be entered in any order. However, some functions may require you to configure specific network information before other commands can be entered. For example, before you can assign a port to a VLAN, you must first create the VLAN. For information about

CLI command requirements, refer to the OmniSwitch CLI Reference Guide.

page 5-2 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Command Entry Rules and Syntax

Offline Configuration Using Configuration Files

CLI configuration commands can be typed into a generic text file. When the text file is placed in the switch /flash/working directory, its commands are applied to the switch when the configuration apply command is issued. Files used in this manner are called configuration files.

A configuration file can be viewed or edited offline using a standard text editor. It can then be uploaded and applied to additional switches in the network. This allows you to easily clone switch configurations.

This ability to store comprehensive network information in a single text file facilitates troubleshooting, testing, and overall network reliability.

See

Chapter 6, “Working With Configuration Files,” for detailed information about configuration files.

Command Entry Rules and Syntax

When you start a session on the switch, you can execute CLI commands as soon as you are logged in. The following rules apply:

• Enter only one command per line.

• No command may be extended across multiple lines.

• Passwords are case sensitive.

• Commands are not case sensitive. The switch accepts commands entered in upper case, lower case or a combination of both.

• Press Enter to complete each command line entry.

• To use spaces within a user-defined text string, you must enclose the entry in quotation marks (“ ”).

• If you receive a syntax error (i.e., ERROR: Invalid entry:), double-check your command as written and re-enter it exactly as described in the OmniSwitch CLI Reference Guide. Be sure to include all syntax option parameters.

• To exit the CLI, type exit and press Enter.

Text Conventions

The following table contains text conventions and usage guidelines for CLI commands as they are documented in this manual.

bold text

“ ” (Quotation Marks)

Indicates basic command and keyword syntax.

Example: show snmp station

Used to enclose text strings that contain spaces

Example: vlan 2 name “new test vlan”

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-3

Command Entry Rules and Syntax Using the CLI

Using “Show” Commands

The CLI contains show commands that allow you to view configuration and switch status on your console screen. The show syntax is used with other command keywords to display information pertaining to those keywords.

For example, the show vlan command displays a table of all VLANs currently configured, along with pertinent information about each VLAN. Different forms of the show vlan command can be used to display different subsets of VLAN information. For example the show vlan rules command displays all rules defined for a VLAN.

Using the “No” Form

The OmniSwitch CLI Reference Guide defines all CLI commands and explains their syntax. Whenever a command has a “no” form, it is described on the same page as the original command. The “no” form of a command will mean one of the following:

• It can remove the configuration created by a command. For example, you create a VLAN with the vlan command, and you delete a VLAN with the no vlan command.

• It can reset a configuration value to its default. For example, you can create a static IGMP entry on a specified port of a specified VLAN with the ip multicast static-group command. You can remove the static IGMP entry from a specified port on a specified VLAN with the no ip multicast static-group command.

Using “Alias” Commands

You may define substitute text for the switch’s CLI commands by using the alias command. There are two main reasons for defining aliases:

• You can eliminate excess typing by reducing the number of characters required for a command.

To reduce the number of characters required to use the group term in a CLI command, you can change the syntax to gp as follows:

-> alias gp group

• You can change unfamiliar command words into familiar words or patterns.

If you prefer the term “privilege” to the term “attribute” with reference to a login account’s read-write capabilities, you can change the CLI word from attrib to privilege by using the following command.

-> alias privilege attrib

After an alias has been defined, both the alias and the original CLI term will be supported as valid CLI terms. For example if privilege is defined as an alias as shown above, both privilege and attrib will work as CLI commands and both words are shown when you use the CLI help feature.

You can save command aliases for the current user account by executing the user profile save command.

If the aliases are not saved they will be stored until the user session ends. In this case, once you log off the switch, substitute terms configured with the alias command are destroyed.

To display aliases, use the show alias command. To set all alias values back to their factory defaults, use the user profile reset command.

page 5-4 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Command Help

Partial Keyword Completion

The CLI has a partial keyword recognition feature that allows the switch to recognize partial keywords to

CLI command syntax. Instead of typing the entire keyword, you may type only as many characters as is necessary to uniquely identify the keyword, then press the Tab key. The CLI will complete the keyword and place the cursor at the end of the keyword.

When you press Tab to complete a command keyword, one of four things can happen:

• You enter enough characters (prior to Tab) to uniquely identify the command keyword.

In this case, pressing Tab will cause the CLI to complete the keyword and place a space followed by the cursor at the end of the completed keyword.

• You do not enter enough characters (prior to Tab) to uniquely identify the command keyword.

In this case pressing Tab will have no effect.

• You enter characters that do not belong to a keyword that can be used in this instance.

In this case, pressing Tab will remove the characters and place the cursor back to its previous position.

• You enter enough characters (prior to Tab) to uniquely identify a group of keywords such that all keywords in the group share a common prefix.

In this case, pressing Tab will cause the CLI to complete the common prefix and place the cursor at the end of the prefix. Note that in this case, no space is placed at the end of the keyword.

Note. The keyword completion feature will accept wildcards.

Command Help

The CLI has an internal help feature you can invoke by using the question mark (?) character as a command. The CLI help feature provides progressive information on how to build your command syntax, one keyword at a time.

If you do not know the first keyword of the command you need, you can use a question mark character at the CLI system prompt. The CLI responds by listing command keywords divided into command sets. You can find the first keyword for the command you need by referring to the list on your screen. The following is a partial display:

-> ?

WHOAMI WHO VIEW VI VERBOSE USER UPDATE TTY TELNET6 TELNET SYSTEM SWLOG SSH6

SSH SHOW SFTP6 SFTP SESSION RZ RMDIR RM RENAME PWD PROMPT NTP NSLOOKUP NO NEWFS

MV MOVE MORE MODIFY MKDIR LS KILL IP INSTALL HISTORY FTP FSCK FREESPACE EXIT

DSHELL DIR DELETE DEBUG CP COMMAND-LOG CHMOD CD AUTO ATTRIB ALIAS

(System Service & File Mgmt Command Set)

(Additional output not shown)

Note that the command keywords are shown in all capital letters. The name of the command set is listed parenthetically below the keywords in initial caps.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-5

Command Help Using the CLI

The following table contains the first-level commands and their set names as they are listed on the display screen when you enter a single question mark and press Enter.

Command Set Name Commands

System Service &

File Management

WHOAMI, WHO, VIEW, VI, VERBOSE, USER, UPDATE, TTY,

TELNET6, TELNET, SYSTEM, SWLOG, SSH6, SSH, SHOW,

SFTP6, SFTP, SESSION, RZ, RMDIR, RM, RENAME, PWD,

PROMPT, NTP, NSLOOKUP, NO, NEWFS, MV, MOVE, MORE,

MODIFY, MKDIR, LS, KILL, IP,

HISTORY, FTP, FSCK, FREESPACE, EXIT, DSHELL, DIR,

DELETE, DEBUG, CP, COMMAND-LOG, CHMOD, CD, AUTO,

ATTRIB, ALIAS

CMM Chassis Supervision COPY, WRITE, POWER, TEMP-THRESHOLD, TAKEOVER,

SYSTEM, SHOW, RRM, RPUT, RLS, RGET, RELOAD, RDF,

RCP, NO, DEBUG, CONFIGURE

Source Learning

Spanning Tree

VLAN

Link Aggregation

Miscellaneous

SOURCE-LEARNING, SHOW, PORT-SECURITY, NO, MAC-

ADDRESS-TABLE, DEBUG

SHOW, BRIDGE

VLAN, SHOW, NO, MAC-ADDRESS-TABLE, DEBUG

AAA & Configuration

Manager

Interface

IP Routing & Multicast

STATIC, SHOW, NO, LINKAGG, LACP

HTTP, TRACEROUTE, SNMP, SHOW, RMON, PORT, POLICY,

PING, NO, MAC-RANGE, MAC, LANPOWER, IP, IPV6, ICMP,

HTTPS, HRE, HEALTH, GMAP, DEBUG, CLEAR, ARP, AMAP,

802.1X

USER, SHOW, PASSWORD, NO, END-USER, DEBUG,

CONFIGURATION, AVLAN, AAA

TRAP, SHOW, NO, INTERFACES, FLOW, DEBUG, 10GIG

DEBUG, VRRP3, VRRP, TRACEROUTE6, SHOW, PING6, NO,

IPV6, IP, CLEAR

QoS

Debug

SHOW, QOS, POLICY, NO, DEBUG

UPDATE, SHOW, NO, DEBUG page 5-6 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Command Help

Tutorial for Building a Command Using Help

The Help feature allows you to figure out syntax for a CLI command by using a series of command line inquiries together with some educated guesses. If you do not know the correct CLI command you can use the Help feature to determine the syntax.

This tutorial shows you how to use help to find the CLI syntax to create a VLAN. This VLAN will be given the ID number 33 and will be named “test vlan 2.”

1 At the command prompt, enter vlan followed by a space and a question mark. The following will display:

-> vlan ?

^

ROUTER <num>

(Vlan Manager Command Set)

PORT NO <num>

(Group Mobility Command Set)

802.1Q <num>

(Miscellaneous Command Set)

The question mark character invokes the help feature, which displays keywords that can be used with the

vlan prefix. Because you are setting up a new VLAN, you can presume the proper command for this task will be shown in the VLAN Manager Command Set. This set shows two possible keywords to follow the

vlan syntax: ROUTER and <num>. Because you are assigning an ID number to the VLAN, you can presume a number should be entered at this time.

Note. The presumptions you make while using the help feature may be educated guesses. Whenever you make a guess as to the next keyword, it is a good idea to enter the keyword followed by a space and a question mark.

2 At the command prompt, enter the number 33 followed by a space and a question mark. This step will either give you more choices or an error message.

-> vlan 33 ?

^

<cr> AUTHENTICATION DISABLE ENABLE NAME NO PORT ROUTER STP

(Vlan Manager Command Set)

BINDING DHCP IP IPX MAC NO PORT PROTOCOL USER

(Group Mobility Command Set)

802.1Q NO

(Miscellaneous Command Set)

In this example, the question mark displays all keywords that can be used with the vlan 33 syntax.

Because you are setting up a new VLAN, and want to give the VLAN a name, you can presume the proper syntax for this task will be NAME as shown in the VLAN Manager Command Set.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-7

Command Help Using the CLI

3 At the command prompt, enter name followed by a space and a question mark. This step will either give you more choices or an error message.

-> vlan 33 name ?

^

<hex> <"string"> <string>

(Vlan Manager Command Set)

There is a smaller set of keywords available for use with the vlan 33 name syntax. This is because the command becomes more specialized as more keywords are added. From the choices shown on the screen, you can enter a hex value, a text string enclosed in quotes (“ ”) or a text string without quotes. In this case, the name selected for the VLAN includes spaces so you should use the syntax enclosed in quotes.

4 At the command prompt, enter the name of the VLAN enclosed in quotes, followed by a space and a question mark.

-> vlan 33 name "test vlan 2" ?

^

<cr>

(Vlan Manager Command Set)

When the question mark is issued this time, the only syntax listed is <cr>. This means that the command syntax is complete. At this point when you press Enter, the command will be issued.

Note. Optional. To verify that the command was accepted, enter the show vlan command. The display is similar to the one shown here.

-> show vlan

vlan admin oper stree auth ip ipx name

-----+-------+------+-------+------+----+-----+---------------------------------

1 on off on off off off VLAN 1

33 on off on off off off test vlan 2

The second entry verifies that a VLAN was created, the VLAN ID is 33 and the name is test vlan 2.

page 5-8 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI CLI Services

CLI Services

There are several services built into the CLI that help you use the interface. The Command Line Editing service makes it easy for you to enter and edit repetitive commands. Other CLI services, such as syntax checking, command help, prefix prompt, and history assist you in selecting and using the correct command syntax for the task you are performing.

Command Line Editing

CLI commands are entered from your keyboard and are executed when you press Enter. The CLI also has several editing features that make it easier for you to enter the correct commands, either by allowing you to correct entry mistakes or by helping you enter the correct command.

Deleting Characters

You can delete CLI command characters by using the Backspace key or the Delete key. The Backspace key deletes each character in the line, one at a time, from right to left. Note the following command entry:

-> show macrocode

The correct syntax is “show microcode”. To change the spelling in this entry, use the Backspace key to delete all of the characters after the “m”.

-> show m

Type the correct syntax, then press Enter to execute the command.

To change incorrect syntax with the Delete key, use the Left Arrow key to move the cursor to the left of the character to be deleted, then use the Delete key to remove characters to the right of the cursor. Note the following command entry:

-> show macrocode

The correct syntax is “show microcode”. To change the spelling in this entry, use the Left Arrow key to place the cursor between the “m” and the “a”.

-> show m

| acrocode

Use the Delete key to remove the “a” and type “i”.

-> show microcode

Press Enter to execute the command.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-9

CLI Services Using the CLI

Recalling the Previous Command Line

To recall the last command executed by the switch, press either the Up Arrow key or the !!

(bang, bang) command at the prompt and the previous command will display on your screen. You can execute the command again by pressing Enter or you can edit it first by deleting or inserting characters.

In the following example, the ls command is used to list the contents of the switch’s /flash/switch directory.

-> ls

Listing Directory /flash/switch: drw 2048 Jan 1 1980 ./ drw 2048 Jan 3 19:23 ../

-rw 308 Jan 1 1980 banner_default.txt

9850880 bytes free

->

To enter this same command again, use the Up Arrow key. The ls command appears at the prompt. To issue the ls command, press Enter.

-> ls

The Up Arrow key and the !!

(bang, bang) command will display the last command line entered even if the command was rejected by the switch.

For more details on using the !!

command, refer to

“Command History” on page 5-13 .

Inserting Characters

To insert a character between characters already typed, use the Left and Right Arrow keys to place the cursor into position, then type the new character. Once the command is correct, execute it by pressing

Enter. In the following example, the user enters the wrong syntax to execute the show microcode command. The result is an error message.

-> show microcode

ERROR: flash: no such directory

To correct the syntax without retyping the entire command line, use the !!

command to recall the previous syntax. Then, use the Left Arrow key to position the cursor between the “r” and the “c” characters. To insert the missing character, type “o”.

-> !!

-> show microcode

To execute the corrected command, press Enter.

page 5-10 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI CLI Services

Syntax Checking

If you make a mistake while entering command syntax, the CLI gives you clues about how to correct your error. Whenever you enter an invalid command, two indicators are displayed.

• The Error message tells you what the error is.

• The caret (^) character tells you where the error is in your syntax.

The following example of the syntax checking feature shows an attempt to set IP routing. If you enter the command set ip routing the following will display:

-> set ip routing enable

^

ERROR: Invalid entry: "set"

The set ip routing command is not valid so the CLI error message states what the problem is (Invalid entry) and the carat indicates where the problem is located in the syntax. Here, the problem is with the

“set” keyword so the carat is located under “set”. The error message states the nature of the problem—that

“set” is an invalid entry. In order to enable IP routing, you must find another command keyword because

set is not valid.

Prefix Recognition

Prefix Recognition is a CLI feature that reduces redundant command line entry by storing prefix information for certain network commands.

When you configure network services, you may have to enter the same command prefix multiple times.

Entering the same prefix again and again can be cumbersome and prone to error. The prefix recognition feature addresses the problem of redundant command entry by allowing the CLI to store commonly-used prefix information. This prefix information stored by the switch then becomes part of the next CLI command entered.

The following command families support the prefix recognition feature:

• AAA

• Interface

• Link Aggregation

• QOS

• Spanning Tree

• VLAN Management

When certain commands are entered from one of these families, the CLI will retain the prefix information in a memory buffer. Then, if a valid related command is entered next, the CLI will assume the stored prefix is part of the next command. In this case, you are only required to enter the suffix information for the next command.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-11

CLI Services Using the CLI

Example for Using Prefix Recognition

This example shows how the Prefix Recognition feature is used for entering multiple commands that have the same prefix. This table lists the tasks to be accomplished in this example and the CLI syntax required for each task.

Task

1. Create a VLAN with an identification number of 501.

2. Enable the spanning tree protocol for VLAN 501.

3. Enable authentication for VLAN 501.

CLI Syntax vlan 501 enable vlan 501 stp enable vlan 501 authentication enable

To create VLAN 501 and configure its attributes using the CLI commands, you could enter the vlan 501 prefix three times. However, VLAN commands support the prefix recognition capability so redundant entry of this prefix is not necessary.

For example, when you enter

-> vlan 501 enable the CLI will automatically store the prefix vlan 501. Now, if you enter a related command for the same

VLAN, you are only required to enter suffix information. In this case, you can enter the commands to accomplish tasks 2, and 3 as follows:

-> stp enable

-> authentication enable

Prefix information will be remembered by the CLI until you enter a command with a new prefix.

Note. If you want to create or configure another VLAN, you must reenter the full command prefix, including the new VLAN ID.

Show Prefix

You can view the current prefix by issuing the show prefix command. If you issue this command when the prefix stored by the CLI is vlan 501 the following will display.

-> show prefix

Current prefix: vlan 501

If you issue the show prefix command when there is no prefix stored by the CLI, a “no prefix” message will display.

page 5-12 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI CLI Services

Prefix Prompt

You may set the CLI so that your screen prompt displays the stored prefix. To display the stored prefix as part of the screen prompt for the VLAN example above, enter the prompt prefix CLI command as follows:

-> prompt prefix

The following will display:

-> vlan 501

Your screen prompt will include your stored prefix until a new prompt is specified. To set the prompt back to the arrow (->) enter the prompt string -> (prompt string arrow) syntax as follows:

-> vlan 501 prompt string ->

->

The arrow displays to indicate that your prompt has changed back to the default.

For more general information about changing the prompt, refer to “Changing the CLI Prompt” on page 5-17 .

Command History

The history command allows you to view commands you have recently issued to the switch. The switch has a history buffer that stores up to 30 of the most recently executed commands.

Note. The command history feature differs from the command logging feature in that command logging stores up to 100 of the most recent commands in a separate command.log file. Also, the command logging feature includes additional information, such as full command syntax, login user name, entry date and time, session IP address, and entry results. For more information on command logging, refer to

“Logging CLI Commands and Entry Results” on page 5-15 .

You can display the commands in a numbered list by using the show history command. The following is a sample list:

-> show history

1 show cmm

2 show fan

3 show sensor

4 show temp

5 ip load dvmrp

6 show arp

7 clear arp

8 show ip config

9 ip helper max hops 5

10 ip bgp pn

11 show ip bgp

12 show history

In the example above, the show history command is listed last because it is the command that was executed most recently.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-13

CLI Services Using the CLI

You can recall commands shown in the history list by using the exclamation point character ( !

) also called

“bang”. To recall the command shown in the history list at number 4, enter !4 (bang, 4). The CLI will respond by printing the number four command at the prompt. Using the history list of commands above, the following would display:

-> !4

-> show temp

You can recall the last command in the history list by issuing the !!

(bang bang) syntax. The CLI will respond by printing the last command in the history list ( show history ) at the prompt as shown here.

-> !!

-> show history

Note. When you use !n or !! to recall a command in the history list, you must press the Enter key to execute the command.

You can configure the number of history commands saved by the switch for display by the show history command. The range for the history size value is 1 to 30. To view the history parameters, use the show history parameters command.

-> history size 30

-> show history parameters

History size: 30

CurrentSize: 10

Index Range: 1-10

The values in this display are defined here:

• History Size: The number of commands the switch will save for display by the show history command.

• Current Size: The number of commands currently saved by the switch, ready for display by the show history command.

• Index Range: This value indicates the index range of the commands for this CLI session currently stored in the history buffer.

In the above example, the switch is set to display 30 commands. However, when the show history

parameters command was issued, only ten commands had yet been issued. Since only ten commands had been issued during the current login session, the index range shows 1 to 10. This is because the commands in the buffer are the first through the tenth commands issued during the current login session.

Note. The Partial Keyword Completion feature described on

page 5-5 works within the CLI history buffer.

page 5-14 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Logging CLI Commands and Entry Results

Logging CLI Commands and Entry Results

OmniSwitch 6800/6850/9000 switches provide command logging via the command-log command. This feature allows users to record up to 100 of the most recent commands entered via Telnet, Secure Shell, and console sessions. In addition to a list of commands entered, the results of each command entry are recorded. Results include information such as whether a command was executed successfully, or whether a syntax or configuration error occurred.

Note. The command history feature differs from the command logging feature in that command history buffers up to 30 of the most recent commands. The command information is not written to a separate log file. Also, the command history feature includes only general keyword syntax (i.e., it does not record full syntax, date and time, session IP address, and entry results). For more information on command history, refer to

page 5-13 .

Refer to the sections below for more information on configuring and using CLI command logging. For detailed information related to command logging commands, refer to the OmniSwitch CLI Reference

Guide.

Enabling Command Logging

By default, command logging is disabled. To enable command logging on the switch, enter the following command:

-> command-log enable

When command logging is enabled via the command-log enable syntax, a file called command.log is automatically created in the switch’s flash directory. Once enabled, configuration commands entered on the command line will be recorded to this file until command logging is disabled.

The command.log file has a 66402 byte capacity. This capacity allows up to 100 of the most recent commands to be recorded. Because all CLI command logging information is archived to the

command.log file, command history information will be lost if the file is deleted.

Note. The command.log file cannot be deleted while the command logging feature is enabled. Before attempting to remove the file, be sure to disable command logging. To disable command logging, refer to the information below.

Disabling Command Logging

To disable the command logging, simply enter the following command:

-> command-log disable

Disabling command logging does not automatically remove the command.log file from the flash directory. All commands logged before the command-log disable syntax was entered remains available for viewing. For information on viewing logged commands, along with the command entry results, refer to

“Viewing Logged CLI Commands and Command Entry Results” on page 5-16 .

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-15

Logging CLI Commands and Entry Results Using the CLI

Viewing the Current Command Logging Status

As mentioned above, the command logging feature is disabled by default. To view whether the feature is currently enabled or disabled on the switch, use the show command-log status command. For example:

-> show command-log status

CLI command logging: Enable

In this case, the feature has been enabled by the user via the command-log command. For more information on enabling and disabling command logging, refer to the sections above.

Viewing Logged CLI Commands and Command Entry Results

To view a list of logged commands, along with the corresponding information (including entry results), enter the show ssh config command. For example:

-> show command-log

Command : ip interface vlan-68 address 168.14.12.120 vlan 68

UserName : admin

Date : MON APR 28 01:42:24

Ip Addr : 128.251.19.240

Result : SUCCESS

Command : ip interface vlan-68 address 172.22.2.13 vlan 68

UserName : admin

Date : MON APR 28 01:41:51

Ip Addr : 128.251.19.240

Result : ERROR: Ip Address must not belong to IP VLAN 67 subnet

Command : ip interface vlan-67 address 172.22.2.12 vlan 67

UserName : admin

Date : MON APR 28 01:41:35

Ip Addr : 128.251.19.240

Result : SUCCESS

Command : command-log enable

UserName : admin

Date : MON APR 28 01:40:55

Ip Addr : 128.251.19.240

Result : SUCCESS

The show command-log command lists up to 100 CLI commands in descending order. In other words, the most recent commands are listed first. In the example above, the command-log enable syntax is the least recent command logged; the ip interface vlan-68 address 168.14.12.120 vlan 68 syntax is the most recent.

Command. Shows the exact syntax of the command, as entered by the user.

UserName. Shows the name of the user session that entered the command. For more information on different user session names, refer to

Chapter 7, “Managing Switch User Accounts.”

Date. Shows the date and time, down to the second, when the command was originally entered.

IP Addr. The IP address of the terminal from which the command was entered.

Result. The outcome of the command entry. If a command was entered successfully, the syntax

SUCCESS displays in the Result field. If a syntax or configuration error occurred at the time a command was entered, details of the error display. For example:

Result : ERROR: Ip Address must not belong to IP VLAN 67 subnet page 5-16 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Customizing the Screen Display

Customizing the Screen Display

The CLI has several commands that allow you to customize the way switch information is displayed to your screen. You can make the screen display smaller or larger. You can also adjust the size of the table displays and the number of lines shown on the screen.

Note. Screen display examples in this chapter assume the use of a VT-100/ASCII emulator.

Changing the Screen Size

You may specify the size of the display shown on your terminal screen by using the tty command. This command is useful when you have a small display screen or you want to limit the number of lines scrolled to the screen at one time. For example, to limit the number of lines to 10 and the number of columns to

150, enter the following:

-> tty 10 150

The first number entered after tty defines the number of lines on the screen. It must be a number between

10 and 150. The second number after tty defines the number of columns on the screen. It must be a number between 20 and 150. You may view the current setting for your screen by using the show tty command.

Changing the CLI Prompt

You can change the system prompt that displays on the screen when you are logged into the switch. The default prompt consists of a dash, greater-than ( -> ) text string. To change the text string that defines the prompt from -> to ##=> use the session prompt command as follows:

->

-> session prompt default ##=>

##=>

The switch displays the new prompt string after the command is entered.

Several building blocks are provided that can automatically display system information along with the prompt string. You can set a switch to display any combination of the current username, system time, system date, and system prefix along with the prompt string. The following command will define the prefix to display the system time and date along with the prompt string defined in the above example:

-> prompt time date string ##=>

01:31:01 04/29/02##=>

For an example of using a stored prefix as part of the prompt, refer to

“Prefix Prompt” on page 5-13 . For

more general information on the session prompt command, refer to the OmniSwitch CLI Reference

Guide.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-17

Customizing the Screen Display Using the CLI

Displaying Table Information

The amount of information displayed on your console screen can be extensive, especially for certain show commands. By default, the CLI will immediately scroll all information to the screen. The more mode can be used to limit the number of lines displayed to your screen. To use the more mode requires two steps as follows:

• Specify the number of lines displayed while in the more mode.

• Enter the more mode.

The more size command specifies the number of lines displayed to the screen while in the more mode.

The following syntax will set the switch to display six lines of data to the screen while in the CLI is in more mode.

-> more size 6

The following command enables the more feature.

-> more

After these commands are executed, the CLI will display no more than 6 lines to the screen at a time followed by the More? prompt. The following is a sample display.

-> show snmp mib family

MIP ID MIB TABLE NAME FAMILY

-------+----------------------------------------+---------------------

6145 esmConfTrap NO SNMP ACCESS

6146 alcetherStatsTable interface

6147 esmConfTable interface

More? [next screen <sp>, next line <cr>, filter pattern </>, quit <q>]

At the More? prompt, you are given a list of options. The output formats are described here:

<sp> Press <sp> (space bar) to display the next page of information.

<cr>

/

<q>

Press <cr> (character return) to display the next line of information

Press / to enter the filter mode. (See “Filtering Table Information” on page 5-19 .)

Press the character “q” to exit More? and return you to the system prompt.

To exit the more mode, use the no more CLI command.

Note. The value set with the more size command applies to the screen display when the CLI is in the more mode or when you are using the switch’s Vi text editor.

page 5-18 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Customizing the Screen Display

Filtering Table Information

The CLI allows you to define filters for displaying table information. This is useful in cases where a vast amount of display data exists but you are interested in only a small subset of that data. Commands showing routing tables are a good example for when you might want to filter information. You can specify a filter that identifies the data that are relevant to your search. The switch will then display the information you identified. This saves you the trouble of scanning long lists of data unnecessarily.

The filter mode filters unwanted information from a CLI table by displaying only those lines containing a specified text pattern (up to 80 characters). Once the filter command has been executed, the filter mode remains active until you reach the end of the CLI table or until you exit the table by using the q command.

The filter command is case sensitive. When using the slash (/) command, you must type the text exactly as it would appear in the CLI table.

For additional information about filtering, refer to “Using a Wildcard to Filter Table Information” on page 5-23 .

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-19

Multiple User Sessions Using the CLI

Multiple User Sessions

Several CLI commands give you information about user sessions that are currently operating on the

OmniSwitch, including your own session. These commands allow you to list the number and types of sessions that are currently running on the switch. You can also terminate another session, provided you have administrative privileges.

Listing Other User Sessions

The who command displays all users currently logged into the OmniSwitch. The following example shows use of the who command and a resulting display:

-> who

Session number = 0

User name = (at login),

Access type = console,

Access port = Local,

IP address = 0.0.0.0,

Read-only rights = 0x00000000 0x00000000,

Read-Write rights = 0x00000000 0x00000000,

Read-only domains = None,

Read-only families = ,

Read-Write domains = None,

Read-Write families = ,

Session number = 1

User name = admin,

Access type = http,

Access port = NS,

IP address = 123.251.12.51,

Read-only rights = 0x00000000 0x00000000,

Read-Write rights = 0xffffffff 0xffffffff,

Read-only domains = None,

Read-only families = ,

Read-Write domains = All ,

Read-Write families = ,

Session number = 3

User name = admin,

Access type = telnet,

Access port = NI,

IP address = 123.251.12.61,

Read-only rights = 0x00000000 0x00000000,

Read-Write rights = 0xffffffff 0xffffffff,

Read-only domains = None,

Read-only families = ,

Read-Write domains = All ,

Read-Write families = ,

The above display indicates that three sessions are currently active on the OmniSwitch. Session number 0 always shows the console port whenever that port is active and logged in. The other sessions are identified by session number, user name, the type of access, port type, IP address, and user privileges. The output

definitions are defined in the table on page 5-21 .

page 5-20 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Multiple User Sessions

Listing Your Current Login Session

In order to list information about your current login session, you may either use the who command and identify your login by your IP address or you may enter the whoami command. The following will display:

-> whoami

Session number = 4

User name = admin,

Access type = telnet,

Access port = NI,

IP address = 148.211.11.02,

Read-only rights = 0x00000000 0x00000000,

Read-Write rights = 0xffffffff 0xffffffff,

Read-only domains = None,

Read-only families = ,

Read-Write domains = All ,

Read-Write families = ,

This display indicates that the user is currently logged in as session number 4, under the username

“admin,” using a Telnet interface, from the IP address of 148.211.11.02.

Session Number

User name

Access type

Access port

Ip Address

Read-only rights

Read-Write rights

Read-only domains

Read-only families

Read-Write domains

Read-Write families

The session number assigned to the user.

User name.

Type of access protocol used to connect to the switch.

Switch port used for access during this session.

User IP address.

The hexadecimal value of privileges configured for the user.

The hexadecimal value of privileges configured for the user.

The command domains available with the user’s read-only access. See

the table beginning on page 5-22 for a listing of valid domains.

The command families available with the user’s read-only access. See

the table beginning on page 5-22 for a listing of valid families.

The command domains available with the user’s read-write access. See

the table beginning on page 5-22 for a listing of valid domains.

The command families available with the user’s read-write access. See

the table beginning on page 5-22 for a listing of valid families.

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-21

Multiple User Sessions Using the CLI

Possible values for command domains and families are listed here: domain domain-admin domain-system domain-physical domain-network domain-layer2 domain-service domain-policy domain-security families file telnet debug system aip snmp rmon webmgt config chassis module interface pmm health ip rip ospf bgp vrrp ip-routing ipx ipmr ipms rdp ospf3 ipv6 vlan bridge stp 802.1q linkagg ip-helper dns qos policy slb session avlan aaa

Terminating Another Session

If you are logged in under the user name admin or diag, you can terminate the session of another user by using the kill command. The following command will terminate login session number 4.

-> kill 4

The command syntax requires you to specify the number of the session you want to kill. You can use the

who command for a list of all current user sessions and their numbers. The kill command takes effect immediately.

page 5-22 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

Using the CLI Application Example

Application Example

Using a Wildcard to Filter Table Information

The wildcard character allows you to substitute the asterisk (*) character for text patterns while using the filter mode.

Note. You must type the wildcard character in front of and after the filter text pattern unless the text pattern appears alone on a table row.

In this example, the show snmp mib family command is used because it displays a long table of MIB information. This example uses the filter option to display only those lines containing the “vlan” character pattern.

1 Use the more command to set the number of displayed lines to 10 and to enable the more mode.

-> more size 10

-> more

To verify your settings, enter the following:

-> show more

The more feature is enabled and the number of line is set to 10

2 Enter the show snmp mib family command. Note that 10 lines of information are displayed. The switch is now in the More? mode as indicated at the bottom of the screen.

-> show snmp mib family

MIP ID MIB TABLE NAME FAMILY

-------+----------------------------------------+---------------------

6145 esmConfTrap NO SNMP ACCESS

6146 alcetherStatsTable interface

6147 esmConfTable interface

6148 ifJackTable interface

7169 dot1qPortVlanTable 802.1Q

7170 qAggregateVlanTable 802.1Q

7171 qPortVlanTable 802.1Q

More? [next screen <sp>, next line <cr>, filter pattern </>, quit <q>]

3 Type the filter pattern “/” command and the following message will automatically appear.

Enter filter pattern:

Enter the desired text pattern, in this case “*vlan*”, at the prompt. Remember to type the text exactly as it would appear in the CLI table and to type the asterisk (*) character before and after the text. The More? mode prompt will automatically re-appear.

Enter filter pattern: *vlan*

More? [next screen <sp>*, next line <cr>*, filter pattern </>*, quit <q>]

OmniSwitch 6800/6850/9000 Switch Management Guide December 2007 page 5-23

Verifying CLI Usage Using the CLI

4 Press the spacebar <sp> key to execute the filter option. The following will display.

Enter filter pattern: *vlan*

8193 dot1qBase vlan

8194 dot1qVlan vlan

8195 dot1qVlanCurrentTable vlan

8196 dot1qVlanStaticTable vlan

8197 vlanMgrVlanSet vlan

8198 vlanTable vlan

8199 vpaTable vlan

9217 vCustomRuleTable vlan

9218 vDhcpGenericRuleTable vlan

9219 vDhcpMacRuleTable vlan

More? [next screen <sp>*, next line <cr>*, filter pattern </>*, quit <q>]

The screen displays 10 table rows, each of which contain the text pattern “vlan” Alcatel-Lucent’s CLI uses a single level command hierarchy. (The screen rows shown above and below the table are not counted as part of the 10 rows.) If you want to display the rows one line at a time, press Enter instead of the space bar key. To exit the table, type the “q” character and the CLI will exit the more mode and return you to the system prompt.

Verifying CLI Usage

To display information about CLI commands and the configuration status of your switch, use the show commands listed here: show session config show alias show prefix show history show more

Displays session manager configuration information (e.g., default prompt, banner file name, and inactivity timer).

Lists all current commands defined by the use of the alias CLI command.

Shows the command prefix (if any) currently stored by the CLI. Prefixes are stored for command families that support the prefix recognition feature.

Displays commands you have recently issued to the switch. The commands are displayed in a numbered list.

Shows the enable status of the more mode along with the number of lines specified for the screen display.

For more information about the resulting displays from these commands, see the OmniSwitch CLI Refer-

ence Guide. Additional information can also be found in

“Using “Show” Commands” on page 5-4 .

page 5-24 OmniSwitch 6800/6850/9000 Switch Management Guide December 2007

advertisement

Related manuals

advertisement

Table of contents