Cisco GSS Command Reference (Software Version 3.0)
Using the Command-Line Interface
Downloads: This chapterpdf (PDF - 215.0KB) The complete bookPDF (PDF - 6.38MB) | Feedback

Using the Command-Line Interface

Table Of Contents

Using the Command-Line Interface

Using Command-Line Processing

Command Modes

Command Mode Structure

EXEC Mode

Global Configuration Mode

DDoS Configuration Mode

DRP Agent Configuration Mode

Interface Configuration Mode

Global Server Load-Balancing Configuration Mode

Checking Command Syntax

Controlling Command Output

Using the Pipe (|) Character

Using grep

Using sort

Using wc

Using monitor

Using the Redirect (>) Character

Using System Help

Saving Configuration Changes


Using the Command-Line Interface


The command-line interface (CLI) is a line-oriented user interface that provides commands for configuring, managing, and monitoring the GSS. To help you use these commands, this chapter contains the following sections:

Using Command-Line Processing

Command Modes

Checking Command Syntax

Using System Help

Saving Configuration Changes

Checking Command Syntax

Controlling Command Output

Using System Help

Saving Configuration Changes

For details about accessing the GSS directly through the console port or remotely by using Telnet or Secure Shell (SSH), see the Cisco Global Site Selector Getting Started Guide, Chapter 2, Accessing the GSS CLI.

Using Command-Line Processing

GSS software commands are not case sensitive. You can abbreviate commands and parameters if they contain enough letters to be different from any other currently available commands or parameters. You can scroll through the last 20 commands stored in the history buffer and enter or edit the command at the prompt. See Table 1-1 for a summary of keystroke combinations supported on the GSS CLI.

Table 1-1 Command-Line Processing Keystroke Combinations 

Keystroke Combination
Description

Ctrl-A

Jumps to the first character of the command line.

Ctrl-B or the Left Arrow key

Moves the cursor back one character.

Ctrl-C

Escapes and terminates prompts and tasks.

Ctrl-D

Deletes the character at the cursor.

Ctrl-E

Jumps to the end of the current command line.

Ctrl-F or the Right Arrow key1

Moves the cursor forward one character.

Ctrl-K

Deletes from the cursor to the end of the command line.

Ctrl-L

Repeats the current command line on a new line.

Ctrl-N or the Down Arrow key1

Enters the next command line in the history buffer.

Ctrl-P or the Up Arrow key1

Enters the previous command line in the history buffer.

Ctrl-T

Transposes the character at the cursor with the character to the left of the cursor.

Ctrl-U; Ctrl-X

Deletes from the cursor to the beginning of the command line.

Ctrl-W

Deletes the last word typed.

Esc-B

Moves the cursor back one word.

Esc-D

Deletes from the cursor to the end of the word.

Esc-F

Moves the cursor forward one word.

Delete key or Backspace key

Erases a mistake when entering a command; reenter the command after using this key.

1 The arrow keys function only on ANSI-compatible terminals such as VT100s.


Command Modes

The GSS CLI supports the following major command modes:

EXEC Mode

Global Configuration Mode

Interface Configuration Mode

Global Server Load-Balancing Configuration Mode

In addition to these four major command modes, several subordinate command modes are accessible from the global server load-balancing configuration mode. See the Command Mode Structure diagram that follows for more details.

Command Mode Structure

The following diagram shows the GSS command mode structure.

EXEC Mode

The two EXEC access levels are privileged and user. The enable and disable commands switch between the two levels. The user-level EXEC command line is available to users if they enter a valid password. The user-level EXEC commands are a subset of the privileged-level EXEC commands. The user-level EXEC prompt is the hostname followed by a right angle bracket (>). The prompt for the privileged-level EXEC command line is the pound sign (#). To execute an EXEC command, enter the command at the EXEC system prompt and press the Return key.

In the following example, a user accesses the privileged-level EXEC command line from the user level as follows:

gssm1.example.com> enable
gssm1.example.com#


Note If you are accessing the GSS remotely using Telnet or SSH, the CLI prompts you for the enable password. The default password is default. For more information about the enable password and configuring a new password, see the "enable-passwd" section on page 2-44.


Use the Delete or Backspace key sequences to edit commands when you type commands at the EXEC prompt.

As a shortcut, you can abbreviate commands to the fewest letters that make them unique. For example, the letters sho can be entered for the show command.

Certain EXEC commands display multiple screens with the following prompt at the bottom of the screen:

--More--

Press the Spacebar to continue the output, or press Return to display the next line. Press any other key to return to the prompt. Also, at the --More-- prompt, you can enter a ? to display the help message.

To leave EXEC mode, enter the exit command at the system prompt:

gssm1.example.com# exit

See the "General Commands" section for detailed information about the EXEC-level commands.

Global Configuration Mode

To enter the global configuration mode, enter the configure privileged EXEC command. You must be in global configuration mode to enter global configuration commands.

gssm1.example.com# configure
gssm1.example.com(config)#

To exit global configuration mode, enter the end global configuration command:

gssm1.example.com(config)# end 

You can also exit global configuration mode by entering the exit command or by pressing Ctrl-Z.

See the " Global Configuration Mode Commands" section for detailed information about the global configuration-level commands.

DDoS Configuration Mode

To enter the Distributed Denial of Service (DDoS) configuration mode, enter the ddos global configuration command as follows:

gssm1.example.com# config
gssm1.example.com(config)# ddos
gssm1.example.com(config-ddos)#

To exit the DDoS configuration mode, enter the exit command to return to global configuration mode as follows:

gssm1.example.com(config-ddos)# exit
gssm1.example.com(config)#

See the "DDoS Module Configuration Mode Commands" section for detailed information about the DDoS configuration-level commands.

DRP Agent Configuration Mode

To enter the Director Response Protocol (DRP) agent configuration mode, enter the drp global configuration command as follows:

gssm1.example.com# config
gssm1.example.com(config)# drp
gssm1.example.com(config-drp)#

To exit DRP Agent configuration mode, enter the exit command to return to global configuration mode as follows:

gssm1.example.com(config-drp)# exit
gssm1.example.com(config)#

See the "DRP Agent Configuration Mode Commands" section for detailed information about the DRP Agent configuration-level commands.

Interface Configuration Mode

To enter interface configuration mode, enter the interface global configuration command as follows:

gssm1.example.com# config
gssm1.example.com(config)# interface ethernet 0
gssm1.example.com(config-eth0)#

To exit the interface configuration mode, enter the exit command to return to global configuration mode as follows:

gssm1.example.com(config-eth0)# exit
gssm1.example.com(config)#

See the "Interface Configuration Mode Commands" section for detailed information about the interface configuration-level commands.

Global Server Load-Balancing Configuration Mode

To enter the global server load-balancing configuration mode, enter the gslb configuration command as follows:

gssm1.example.com# config
gssm1.example.com(config)# gslb
gssm1.example.com(config-gslb)# proximity group ProxyGroup1 ip 
192.168.9.0 255.255.255.0

To exit the global server load-balancing configuration mode, enter the exit command to return to global configuration mode as follows.

gssm1.example.com(config-gslb)# exit
gssm1.example.com(config)#

See the "Global Server Load-Balancing Configuration Mode Commands" section for detailed information about the global sever load-balancing configuration-level commands.

Checking Command Syntax

The user interface provides error isolation in the form of an error indicator, a caret symbol (^). The ^ symbol appears at the point in the command string where you have entered an incorrect command, keyword, or argument.

In the following example, a syntax error occurs in the process of setting the device clock. Context-sensitive help is then used to check the syntax for setting the clock and correct the mistake.

gssm1.example.com#clock 20:06:00 26 july 2003
	       ^
% Invalid input detected at '^' marker.

gssm1.example.com#clock ?
  set       Set the time and date
  timezone  Set timezone

The help output shows that the set keyword is required. Press the Up Arrow to automatically repeat the previous command. Add a space and question mark (?) to display the following additional arguments:

gssm1.example.com#clock set ?
  <0-23>:  Current Time (hh:mm:ss)

gssm1.example.com#clock set 20:00:00
% Incomplete command.
gssm1.example.com#clock set 20:00:00?
<0-59>  
gssm1.example.com#clock set 20:00:00 ?
  <1-31>     Day of Month
  april      
  august     
  december   
  february   
  january    Month of the Year
  july       
  june       
  march      
  may        
  november   
  october    
  september  
gssm1.example.com#clock set 20:00:00 july ?
  <1-31>  Day of Month
gssm1.example.com#clock set 20:00:00 july 26 ?
  <1993-2035>  Year
gssm1.example.com#clock set 20:00:00 july 26 2004

Controlling Command Output

You can control the output of your GSS CLI commands (filtering it or saving it to a file) using special operators that are added to your command syntax. The following table presents information about the various command options that allow you to control the output generated by GSS commands.

Follow these guidelines when using the CLI output commands:

You cannot use certain symbols (such as `, ;, or <) when using the | (pipe) or > (redirect) commands

You can only use a single | (pipe) or a single > (redirect) command. The GSS software does not support the simultaneous use of both output commands.

Using the Pipe (|) Character

You can use the pipe (|) character to direct the output of any GSS command to a short list of operators: grep, sort, wc, and monitor. For example, to see all logs related to the GSS keepalive function, enter the following:

show logs | grep -i KALE

The following sections discuss the use of the grep, sort, wc, and monitor operators with the pipe (|) character.

Using grep

The | grep operator filters CLI command output to display only the output containing the lines of text that match the specified text. The following example lists only files containing "log" in a directory:

gssm1.example.com> ls
platform.cfg
props.cfg
props.cfg.startup
runmode-comment
running.cfg
squid
sysMessages.log
syslog-messages.log
sysmsg
sysout
system.log
tmp
tomcat
trace.log

gssm1.example.com> ls |grep log
sysMessages.log
syslog-messages.log
system.log
trace.log

For a detailed list of the options supported by the grep operator, see the documentation provided with the Linux operating system.

Using sort

The | sort operator performs a sort of all files associated with a CLI command. The following example performs a reverse sort of all files appearing in a directory:

gssm1.example.com> ls
platform.cfg
props.cfg
props.cfg.startup
runmode-comment
running.cfg
squid
sysMessages.log
syslog-messages.log
sysmsg
sysout
system.log
tmp
tomcat
trace.log

gssm1.example.com> ls | sort -r
trace.log
system.log
sysout
sysmsg
syslog-messages.log
sysMessages.log
squid
tmp
tomcat
running.cfg
runmode-comment
props.cfg.startup
props.cfg
platform.cfg

For a detailed list of the options supported by the sort operator, see the documentation provided with the Linux operating system.

Using wc

The | wc operator displays the total number of bytes, words, or lines in a file. The following example shows the number of log messages currently in the main log file (gss.log):

gssm1.example.com> show logs | wc -l
	2236

For a detailed list of the options supported by the wc operator, see the documentation provided with the Linux operating system.

Using monitor

The | monitor operator continuously displays the output of a show command. The monitor operator invokes the Linux watch command, which updates the screen every two seconds, allowing you to watch the show command output change over time. The following example displays the output of the show statistics keepalive answer type command, updating the screen every two seconds with the latest output:

gssm1.example.com> show statistics keepalive answer type vip 
192.168.200.1 | monitor
EEvery 2s: cli-stat kalestat ip-address answer vip 0x101010b                                      
Wed Feb  8 10:01:43 2006
                                                                                                                         
IP: 192.168.200.1
GID: 17728 LID: 1
Status: ONLINE
No of Keepalives Configured: 1
Keepalive => 10.1.1.1
Status: ONLINE
Keepalive Type: kalap, Shared, Standard
Primary Circuit:          10.1.1.1
Load:                           10
Circuit Transitions:             0
VIP Failovers:                   0
Packets Sent:                 1279
Packets Received:               26
Positive Probe:                 26
Negative Probe:                940
Transitions:                     4

Using the Redirect (>) Character

You can use the Redirect (>) operator to redirect the output of a command to a file. You may only redirect to a file in the current working directory, as determined using the pwd command.

For example, enter the following command:

gssm1.example.com# show running-config>running-config.txt

Using System Help

You can obtain help when you enter CLI commands by using the following methods:

To display a brief description of the context-sensitive help system, enter help.

To list all commands for a command mode, enter a question mark (?) at the system prompt.

To obtain a list of commands that start with a particular character set, enter an abbreviated command immediately followed by a question mark (?).

gssm1.example.com# cl?
clear clock

To list the command keywords or arguments, enter a space and a question mark (?) after the command:

gssm1.example.com# clock ?
  clear  Clear the current time from the battery-backed clock
  save   Save the current time into the battery-backed clock
  set    Set the local time and date

Saving Configuration Changes

To avoid losing new configurations, save them to NVRAM using the copy or write commands, as shown in the following example:

gssm1.example.com# copy running-config startup-config

or

gssm1.example.com# write memory

See the copy running-config startup-config command description in Chapter 2, Cisco Global Site Selector CLI Commands, for more information.