4.4 set CLI Command


4.4 set CLI Command

To set the CLI environment to your liking, you can use the set CLI command. The set CLI ? , in the example below, lists the available parameter options. Explanations of each follow.

 lab@Chicago> set CLI ?  Possible completions:   complete-on-space    Toggle word completion on space   idle-timeout         Set the CLI maximum idle time   prompt               Set the CLI command prompt string   restart-on-upgrade   Set 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 

4.4.1 set CLI complete-on-space

The set CLI complete-on-space command enables the automatic completion of a partial command when you press the space bar, provided that the command is unambiguous. By default, this command is set to on . The syntax for this command is as follows :

 set CLI complete-on-space <onoff> 

The following example shows how to use this command. The user types show p and presses the space bar. There is not a command called p , so the output displays that p is ambiguous. However, it also displays all of the commands that start with the letter p. The user now decides that she wants to find out what types of policy are active on the router. She adds an o to the show p , and presses the space bar, which completes the command policy.

 lab@Chicago> show p                     ^ 'p' is ambiguous. Possible completions:   pfe                  Show packet forwarding engine data   pim                  Show information about PIM   policy               Show policy information lab@Chicago> show po<space> lab@Chicago> show policy 

Note

Using the space bar is similar to pressing the tab key, however the tab key will also complete user-configured parameters in the configuration mode, whereas the space bar will not.


4.4.2 set CLI idle-timeout

The set CLI idle-timeout command lets you set the maximum amount of time, in minutes, that the CLI session will remain open without any activity. The time value is a range between 0 and 100,000 minutes. Setting the timeout value to 0 will disable the idle-timeout and CLI session will not expire. The default idle-timeout is set to 0 or disabled. The syntax is as follows:

 set CLI idle-timeout <timeout> (0-100000 minutes) 

The following example shows how idle-timeout works. The idle-timeout has been set to one minute, and there has been no activity for 50 seconds. When there are ten seconds remaining before the session is going to expire, the CLI warns the user that the session will be closed if there is no further activity. The ten seconds then expire, and we are notified on the console that the idle-timeout has been exceeded and the session is closing.

 lab@Chicago> set CLI idle-timeout 1  Idle timeout set to 1 minute lab@Chicago> Warning: session will be closed in 10 seconds if there is no activity Idle timeout exceeded: closing session Chicago (ttyd0) login: 

4.4.3 set CLI prompt

Changing the default prompt of a CLI session can be done by using the operation mode set cli prompt command to change the prompt as it is displayed.

 lab@Chicago> set cli prompt <cli-prompt> 

The following example shows how to change the prompt Chicago to newprompt :

 Chicago>set cli prompt newprompt  newprompt> 

4.4.4 set CLI restart-on-upgrade

The default setting for the set CLI restart-on-upgrade command is on . This means that after a software upgrade is performed, you will be prompted to restart the router. If you want to disable this for the session, you can set the parameter to off . The syntax required to enable and disable the command is as follows:

 set CLI restart-on-upgrade <onoff> 

4.4.5 set CLI screen-length and screen-width

The set screen-length and set screen-width commands are used for making adjustments to the CLI screen. Setting the screen length will affect the number of lines that are displayed on your screen at one time. After the specified number of lines, your output will pause, and a -(more)- prompt will be displayed. This -(more)- prompt will allow you to advance the displayed output either one line at a time by pressing the enter key or one page at a time by pressing the space bar. The size of the page corresponds to the number value set for the screen length. The default screen length is 24. Setting the screen length to 0 will allow the displayed output to scroll without pause. This is useful for capturing output into a file or for using scripting languages when interacting with the router. Setting the screen width will adjust the number of columns that are displayed on the screen. The default value for screen width is 80.

The syntax for setting the screen length and screen width are as follows:

 set CLI screen-length <length> Number of lines on screen (0..100000)  set CLI screen-width <width> Number of characters on a line (0..100000) 

The following examples show how to set these commands:

 lab@Chicago> set CLI screen-length 2  Screen length set to 2 lab@m5upper> set CLI screen-width 5 Screen width set to 5 

4.4.6 set CLI terminal

In the past, terminals have commonly been referred to as dumb terminals. They do not have a lot of intelligence built in. They usually consist of a keyboard for entering data and a screen for displaying output. These terminals, however, have been used for many years as an inexpensive way to monitor and control devices. In addition to these dumb terminals, terminal emulation is also available. Terminal emulation is used on a more intelligent device, such as a PC, to connect to the same devices that were once controlled by dumb terminals.

A good example of a terminal emulator is your PC running some type of terminal emulation software. This software and your PC together will act as a dumb terminal and usually can be configured to speak several different terminal languages, such as vt100. The Juniper Networks router can be configured to work with several different terminal types. Setting the terminal type can be done with the set CLI terminal command. The example below lists the selectable terminal types:

 lab@Chicago> set CLI terminal ?  Possible completions:   ansi                 ANSI-compatible terminal   small-xterm          Small (24 line) xterm window   vt100                VT100-compatible terminal   xterm                Large (65 line) xterm window 

Note

Terminal settings that are set in operational mode are only valid for the length of the session. The default terminal type is unknown.


4.4.7 set date

Setting the date and time can be done by using operational-mode commands. The syntax for this is as follows:

 set date <time>  New date and time (YYYYMMDDhhmm.ss) 

The following example shows a sample setting:

 lab@Chicago> set date 200202171448.00  Sun Feb 17 14:48:00 UTC 2002 

Note

It may be necessary to use the set date command even when using the Network Time Protocol (NTP), as NTP will fail if the time difference between router and NTP server is large. This will be noted in the logs.


Note

When setting the date and time, do not use any slashes or dashes.




Juniper Networks Reference Guide. JUNOS Routing, Configuration, and Architecture
Juniper Networks Reference Guide: JUNOS Routing, Configuration, and Architecture: JUNOS Routing, Configuration, and Architecture
ISBN: 0201775921
EAN: 2147483647
Year: 2002
Pages: 176

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