When we log in as the root user, the software places us at the UNIX shell. a 'cli' command is used to switch us to the CLI mode. When we exit the CLI, we return to the UNIX shell. 'exit' command is used to log out of the shell. Different Modes:
- Operational Mode: In this mode, we use the CLI to monitor and troubleshoot the device. Different commands such as monitor, ping, show, test and traceroute are used in this mode. They let us to display information and test the connectivity of our network. The character '>' identifies the operational mode. E.g. user@router>
- Configuration Mode: In configuration mode, we can configure all the properties of the Junos OS. It includes, interfaces, protocols, user access as well as several system hardware properties. 'edit' command is used to switch to configuration mode from operational mode. The '#' character identifies the configuration mode. E.g. user@router#
Basic Helpful Commands:
- The Junos CLI provides context-sensitive help at any point in a command line. It tells us which options are acceptable at the current point in the command provides a brief description of each command or options. '?' is a universal help command in Junos OS. So, we can get help at any time, we just type '?' mark.
- A spacebar in Junos CLI is used for the completion for commands. So, that we are not always required to type the full command or the command option name for the CLI to recognize it. To complete a command or option that you have partially typed, press the spacebar. If the partially typed letters begin a string that uniquely identifies a command, the CLI displays the complete command name. Otherwise, the CLI beeps to indicate that you have entered an ambiguous command, and it displays the possible completions also. The command completion option is 'on' by default and can be turned 'off'. 'set cli complete-on-space off' command is used to disable the command.
- 'Tab' Key can be used to complete system commands and user-deficed variables. Examples of variables include policy names, AS paths, community names and IP addresses. Tab key also offers a list of possible completions if multiple, ambiguous options exists. It helps to save time and reduce keystrocks and prevent errors.
- Emacs-Style Control Keys: The CLI supports Emacs-style keyboard sequences that allows us to move the cursor on a command line and delete specific characters or words.
- Use of Pipe (|): As in UNIX pipe is used to filter the give out desired output. The help (?) can be added after the (|) which displays the possible completions for output.
No comments:
Post a Comment