You will be working with:
● vMX-VCP1 (Control Plane for vMX-1)
This lab introduces you to Junos's comprehensive built-in help system. You will learn to use context-sensitive help, command completion, and various help commands to discover configuration options and syntax without relying on external documentation. Mastering these tools will significantly increase your efficiency when working with Junos devices.
1. Open a console connection to the vMX-VCP1 device.
2. Log in with username root and password uninets@123.
3. Enter the Junos CLI: cli (you should be at root> prompt).
4. From Operational Mode, access the basic help system:
? (just type a question mark and press Enter)
Observation: You see a list of all available commands in Operational Mode, showing just the first word of each command. This is your starting point for discovering what you can do from this mode.
5. Now try more specific help:
s? (type the letter 's' followed immediately by ? with no space)
Observation: You now see only commands that begin with the letter 's'. This is extremely useful when you remember the beginning of a command but not the full syntax.
1. Let's explore the configure command options:
configure ? (type 'configure', then a space, then ?)
Observation: You see:
● configure listed with <[Enter]> - meaning you can just press Enter after 'configure'
● Other possible completions like configure exclusive, configure private, etc.
● This shows you all available options that can follow 'configure'
2. Enter Configuration Mode:
configure (press Enter)
You should now be at [edit] level (root# prompt).
Before testing help features, let's create some configuration elements to work with:
1. Create a custom login class named UNINETS with full permissions:
set system login class UNINETS permissions all
2. Create a user named Bob and assign him to the UNINETS class:
set system login user Bob class UNINETS
3. Set an authentication method for Bob (we'll use plain text for lab purposes):
set system login user Bob authentication plain-text-password
4. When prompted, set Bob's password to uninets@123 (enter it twice).
5. Commit these changes so they're available for testing:
commit and-quit
You're now back in Operational Mode.
1. Re-enter Configuration Mode: configure
2. Test TAB completion with our custom class:
● Start typing: set system login user Bob class (include the trailing space)
● Now type: U (capital U)
● Press the SPACE BAR
Observation: The space bar simply adds a space after the 'U'. It does not complete the word 'UNINETS'.
3. Let's try again with TAB:
● Type: set system login user Bob class U (again, capital U)
● Press the TAB key
Observation: Junos automatically completes 'UNINETS' for you! The TAB key triggers command completion, while the space bar does not.
Key Concept: TAB completion is context-aware and can complete:
● Built-in Junos keywords
● User-defined variables (like our UNINETS class)
● Interface names
● Protocol names And much more
Cancel this command by pressing Ctrl+C.
The help apropos command searches for commands containing specific keywords.
1. From Configuration Mode ([edit] level), search for all commands containing "route" but not "router":
help apropos "route " (note the space after "route")
Observation: You see commands that include "route" followed by a space. This excludes commands with "router" since "router" doesn't have a space after "route".
2. Now navigate deeper and see how the context changes:
● Move to system configuration: edit system
● Run the same search: help apropos "route "
Observation: Fewer results! From within [edit system], you only see route-related commands available at or below this configuration level.
3. Move to services configuration: edit services
● Run the search again: help apropos "route "
Observation: Different results appear, showing route-related commands available within services configuration.
4. Return to Operational Mode to see the difference:
top then exit
5. From Operational Mode, run the same search:
help apropos "route "
Observation: You now see Operational Mode commands containing "route" (like show route, clear route, etc.), but no Configuration Mode set commands.
Key Concept: help apropos is context-sensitive. It shows commands available from your current location in the configuration hierarchy.
1. From Operational Mode, try the interactive tip system:
help tip cli
Press Enter 7-8 times to see different CLI tips. Each time you press Enter, you get a new useful tip about Junos CLI usage.
2. Try topic-based help:
help topic ospf area
Observation: This gives you conceptual information about OSPF areas – what they are, how they work, and their purpose.
3. Try reference-based help:
help reference ospf area
Observation: This gives you technical reference information – syntax, options, and configuration examples for OSPF area commands.
Comparison:
● help topic: Conceptual/educational information
● help reference: Technical/syntax reference
● help apropos: Keyword search across commands
Let's solve a real problem using the help system:
Scenario: You need to configure NTP (Network Time Protocol) but don't remember the exact syntax.
1. From Operational Mode, enter Configuration Mode: configure
2. Use help apropos to find NTP-related commands:
help apropos ntp
3. Based on the results, you might see system ntp. Explore this:
edit system then set ntp ?
4. The help shows you need a server. Try:
set ntp server ?
5. You see you need an IP address. Let's configure a server:
set ntp server 10.1.1.100
6. Exit without saving (since this was just practice):
rollback then exit configuration-mode
1. When you don't know a command:
● First try: ? from your current mode/level
● If you know the first letter: <letter>?
● If you know a keyword: help apropos "<keyword>"
2. When you need to understand a concept:
● Use: help topic <subject>
3. When you need syntax details:
● Use: help reference <command>
● Or: <partial-command> ?
4. Practice this methodology:
● Find commands related to "snmp": help apropos snmp
● Learn about BGP: help topic bgp (from Operational Mode)
● Get syntax for configuring a static route: help reference routing-options static route
Based on what you've learned, here's a quick reference table:
| When You Need | Use This Command | Example |
|---|---|---|
| See all commands at current level | ? | ? |
| See commands starting with... | s? | |
| See options for a command | show ? | |
| Search for keyword in commands | help apropos "keyword" | help apropos "ospf" |
| Conceptual explanation | help topic | help topic vlan |
| Syntax reference | help reference | help reference interfaces |
| CLI tips & tricks | help tip cli | help tip cli |
| Command completion | Type partial command + TAB | set inter + TAB |
● On-the-Job Troubleshooting: When you encounter an unfamiliar configuration section, use help apropos to quickly find relevant commands.
● Learning New Features: Use help topic to understand new protocols or features before configuring them.
● Script Writing: Use help reference to get exact syntax when writing automation scripts.
● Efficiency: TAB completion can save significant time when typing long configuration paths.
● Use quotes with spaces: When searching with help apropos, include a space in quotes (like "route ") to exclude similar words.
● Combine approaches: Often use help apropos to find a command, then help reference to get its exact syntax.
● Remember context: Help results differ between Operational and Configuration Modes, and between different configuration levels.
● Practice regularly: The more you use the help system, the faster you'll become at finding what you need.
● Forgetting the space: help apropos route finds both "route" and "router". help apropos "route " finds only "route".
● Wrong mode: Looking for set commands from Operational Mode won't work – you need to be in Configuration Mode.
● Wrong level: If you're deep in the configuration hierarchy, help apropos might not show commands available at higher levels.