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
Setting the Date and TimeTo 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 HistoryTo 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 CLIDepending 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 EnvironmentTo 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
|