CLI Operational Mode


The CLI operational mode provides commands to monitor the router and the network and to perform system-level operations. When you log in to the router and the CLI starts, you are at the top level of operational mode. In operational mode, the prompt is a > . Table 5.5 describes these top-level operational mode CLI commands.

Table 5.5. Top-Level Operational Mode CLI Commands
Category Command Description
Control the CLI environment. set Configure the CLI display screen.
Monitor and troubleshoot. clear Clear statistics and protocol database information.
  mtrace Trace multicast routes.
  monitor Perform real-time debugging of various software components , including the routing protocols and interfaces.
  ping Determine the reachability of a remote network host.
  show Display the current configuration and information about interfaces, routing protocols, routing tables, routing policy filters, and the chassis.
  test Test the configuration and application of policy filters and AS path regular expressions.
  traceroute Trace the route to a remote network host.
Connect to other network systems.

ssh

telnet

Open a secure shell connection.

Opens Telnet sessions to another host on the network.

Copy files. file copy Copy files from one location on the router to another, from the router to a remote system, or from a remote system to the router.
Restart software processes. restart Restart the JUNOS software processes.
Install and manage software and system-level operations. request Perform system-level operations, including stopping and rebooting the router and loading JUNOS software images.
Exit the CLI.

start

quit

Exit the CLI and start a UNIX shell.

Exit the CLI.

Configure the router. configure Enter configuration mode.

Setting the Date and Time

To set the date and time on the router, use the set date operational mode command:

 user@host>  set date YYYYMMDDhhmm.ss  

YYYY is the four-digit year, MM is the two-digit month, DD is the two-digit date, hh is the two-digit hour , mm is the two-digit minute, and ss is the two-digit second.

If the NTP server is unable to synchronize the current date and time on the router, a system log message similar to the following appears:

 "time error  %.0f  over  %d  seconds; set clock manually". 

To set the date and time from all NTP servers configured at the [edit system ntp server] hierarchy level to determine the correct time, use the set date ntp command:

 user@host>  set date ntp  

Displaying CLI Command History

To display a list of recently issued commands, use the show cli history operational mode command. By default, this command displays the last 100 commands issued in the CLI. If you specify a number with the command, it displays that number of recent commands.

 user@host>  show cli history  03-03 01:00:50 -- show cli history   03-03 01:01:12 -- show interfaces terse   03-03 01:01:22 -- show interfaces lo0   03-03 01:01:44 -- show bgp next-hop-database   03-03 01:01:51 -- show cli history 

Monitoring Who Uses the CLI

Depending on how you configure the JUNOS software, multiple users can log in to the router, use the CLI, and configure or modify the software configuration. The JUNOS software provides a general syslog -like mechanism to log system operations, such as when users log in to the router and when they issue CLI commands. To configure system logging, include the syslog statement in the configuration.

Controlling the CLI Environment

To configure the CLI environment, use the set operational mode CLI command:

 user@host>  set cli ?  Possible completions:   complete-on-spaceToggle word completion on space   idle-timeout   Set the cli maximum idle time   prompt         Set the cli command prompt string   restart-on-upgradeSet cli to prompt for restart after a software upgrade   screen-length  Set number of lines on screen   screen-width   Set number of characters on a line   terminal       Set terminal type 

When you log in to the router using ssh, or log in from the console when its terminal type is already configured, the terminal type, screen length, and screen width are already set, so you do not need to change them from the CLI. Table 5.6 describes the various ways you can control the CLI environment.

Table 5.6. Controlling the CLI Environment
Description Command Comment
Terminal type set cli terminal terminal-type Terminal type can be ansi , vt100 , small- xterm , or xterm .
Screen length set cli screen-length length Default screen length is 24 lines. Setting the length to 0 lines disables the display of output one screen at a time.
Screen width set cli screen-width width Default width is 80 columns .
Prompt set cli prompt string Default prompt is user@host> . If the prompt string contains spaces, enclose the string in quotation marks (" ").
Maximum time an individual session can be idle before the user is logged off the router set cli idle-timeout timeout By default, an individual CLI session never times out after extended times, unless the idle-timeout statement has been included in the user's login class configuration. timeout can be 0 through 100,000 minutes. Setting timeout to 0 disables the timeout.
Prompt after upgrade

Disable the prompt for an individual session:

 set cli restart-on-upgrade off 
By default, the CLI prompts to restart after a software upgrade.To re-enable the prompt, use the set cli restart-on-upgrade on command.
Command completion Have the CLI allow only a tab to complete a command:
 set cli complete-on-space off 
By default, press the spacebar or tab key to have the CLI complete a command.To re-enable the use of both spaces and tabs for command completion, use the set cli complete-on-space on command.
Display current settings show cli  


Juniper Networks Field Guide and Reference
Juniper Networks Field Guide and Reference
ISBN: 0321122445
EAN: 2147483647
Year: 2002
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net