> For the complete documentation index, see [llms.txt](https://jncia-workbook.gitbook.io/workbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jncia-workbook.gitbook.io/workbook/junos-basics/13-cli-help.md).

# 13) CLI Help

### Pre-Work

If you made any changes, you can quickly revert the lab using the **load\_config\_on\_nodes.py** script.

```
python3 load_config_on_nodes.py --lab_dir three-routers --config_filename basic.addressing.cfg
```

### Lab

You've been asked to set the maximum number of CLI sessions on R1 to 5. However, you cannot remember where exactly you set this in the configuration.&#x20;

Using only the built-in CLI help, quickly find the command needed to set the maximum number of CLI sessions.

### Answer

<details>

<summary>Expand to reveal</summary>

We can use the `help apropos` in config mode to find the set command that we need. This help command takes a regex as input, and searches for matching CLI commands and CLI command descriptions.

\
For example, you might use `"max.* num.* cli"`. The wildcards are to match "max" or "maximum" and "num" or "number." The regex is case insensitive already.

\
From this, you can find the command you need: `set system max-cli-sessions <num>`

```
[edit]
admin@R1# help apropos "max.* num.* cli"       
set system max-cli-sessions <max-cli-sessions> 
    Maximum number of cli sessions
set logical-systems <name> routing-instances <instance_name> routing-options bmp max-clients <max-clients> 
    Max number of BMP server clients
set logical-systems <name> routing-instances <instance_name> routing-options bmp station <station-name> max-clients <max-clients> 
    Max number of BMP server clients
set logical-systems <name> routing-options bmp max-clients <max-clients> 
    Max number of BMP server clients
set logical-systems <name> routing-options bmp station <station-name> max-clients <max-clients> 
    Max number of BMP server clients
set services rpm twamp server maximum-sessions-per-connection <maximum-sessions-per-connection> 
    Maximum number of test sessions per client connection
set services rpm twamp server maximum-connections-per-client <maximum-connections-per-client> 
    Maximum number of server connections per client
set access group-profile <name> l2tp maximum-sessions <maximum-sessions> 
    Maximum number of sessions per client
set access profile <profile-name> client <name> l2tp maximum-sessions <maximum-sessions> 
    Maximum number of sessions per client
set routing-instances <instance_name> routing-options bmp max-clients <max-clients> 
    Max number of BMP server clients
set routing-instances <instance_name> routing-options bmp station <station-name> max-clients <max-clients> 
    Max number of BMP server clients
set tenants <tenant_name> routing-instances <instance_name> routing-options bmp max-clients <max-clients> 
    Max number of BMP server clients
set tenants <tenant_name> routing-instances <instance_name> routing-options bmp station <station-name> max-clients <max-clients> 
    Max number of BMP server clients
set routing-options bmp max-clients <max-clients> 
    Max number of BMP server clients
set routing-options bmp station <station-name> max-clients <max-clients> 
    Max number of BMP server clients

[edit]
admin@R1# 
```

Another option might be `"cli.* session"`:

```
[edit]
admin@R1# help apropos "cli.* session"    
set system max-cli-sessions <max-cli-sessions> 
    Maximum number of cli sessions
set services rpm twamp client control-connection <control-client-name> destination-port <destination-port> 
    TCP TWAMP client listening port for the test sessions. Default 862
set access profile <profile-name> session-options 
    Options for an authenticated client's session
set access domain map <name> dynamic-profile <dynamic-profile> 
    Dynamic profile to be used for this client's session
set access domain map <name> target-routing-instance 
    Routing instance the client's session will be mapped to
set access domain map <name> target-logical-system 
    Logical system the client's session will be mapped to
set access domain map <name> target-logical-system <logical-system-name> target-routing-instance 
    Routing instance the client's session will be mapped to
set access domain map <name> tunnel-profile <tunnel-profile> 
    Tunnel profile to be used for this client's session
set access domain map <name> sub-domain <sub-domain-name> dynamic-profile <dynamic-profile> 
    Dynamic profile to be used for this client's session
set access domain map <name> sub-domain <sub-domain-name> target-routing-instance 
    Routing instance the client's session will be mapped to
set access domain map <name> sub-domain <sub-domain-name> target-logical-system 
    Logical system the client's session will be mapped to
set access domain map <name> sub-domain <sub-domain-name> target-logical-system <logical-system-name> target-routing-instance 
    Routing instance the client's session will be mapped to
set access domain map <name> sub-domain <sub-domain-name> tunnel-profile <tunnel-profile> 
    Tunnel profile to be used for this client's session

[edit]
admin@R1# 

```

</details>

### Explanation

<details>

<summary>Expand to reveal</summary>

The word *apropos* is of French origin, and has multiple meanings. In this context, we can think of it as "regarding" or "concerning." So `help apropos ospf` would be "help regarding OSPF." This most likely comes from Linux, where the `apropos` command does something very similar, searching manpages for the given keyword. On Junos, `help apropos` searches the Junos CLI for commands or descriptions which match the given keyword.

\
`Help apropos` can be used in both operational mode and config mode. In each mode, it only searches for available commands in that given mode. You use `help apropos` when you are "searching for the command you need."

Note that you do not need to use a regex, but it helps to narrow down what you are searching for. For example, you can simply do `help apropos aigp` but this will give you tons of matches:

```
[edit]
admin@R1# help apropos aigp | count    
Count: 2214 lines
```

You could further narrow down with `| match` commands:

```
[edit]
admin@R1# help apropos aigp | match "set protocols" | count 
Count: 192 lines
```

An even more efficient way is to navigate to the configuration hierarchy you are interested in. The `help apropos` tool will only search within that hierarchy.

```
[edit protocols bgp group IBGP]
admin@R1# help apropos aigp | count    
Count: 256 lines
```

Another example is below, using `help apropos` to find the syntax for a holddown timers in OSPF:

```
[edit protocols ospf]
admin@R1# help apropos holddown    
set topology spf-options holddown <holddown> 
    Time to hold down before running an SPF
set topology spf-options rapid-runs <rapid-runs> 
    Number of maximum rapid SPF runs before holddown
set spf-options holddown <holddown> 
    Time to hold down before running an SPF
set spf-options rapid-runs <rapid-runs> 
    Number of maximum rapid SPF runs before holddown
set area <area_id> interface <interface_name> bfd-liveness-detection holddown-interval <holddown-interval> 
    Time to hold the session-UP notification to the client

[edit protocols ospf]
admin@R1# 
```

There are three other `help` tools to be aware of:

* `help topic` - This gives information about features and configuration tasks. This is for high-level usage guidelines.
  * This does not seem to be available in vJunos-Router. Perhaps it is not loaded onto the image to save space. It is available on cRPD.
* `help reference` - This essentially displays a manpage for the given feature. This gives you configuration syntax help.
  * This is available on vJunos-Router, but seems to be a paired-down version.
* `help syslog` - This gives information about syslog messages.

#### Examples

<figure><img src="/files/vj0i42jWAvT4X8VmnmjU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0w5icRnftufTeWShBvtG" alt=""><figcaption></figcaption></figure>

```
admin@R1> help reference protocols bgp aigp    
                                      aigp

Syntax

 aigp [disable];

Hierarchy Level

 [edit logical-systems logical-system-name protocols bgp family inet],
 [edit logical-systems logical-system-name protocols bgp family inet6],
 [edit logical-systems logical-system-name protocols bgp family inet labeled-unicast],
 [edit logical-systems logical-system-name protocols bgp family inet6 labeled-unicast],
 [edit logical-systems logical-system-name protocols bgp group group-name family inet labeled-unicast],
 [edit logical-systems logical-system-name protocols bgp group group-name family inet6 labeled-unicast],
 [edit logical-systems logical-system-name protocols bgp group group-name family inet],
 [edit logical-systems logical-system-name protocols bgp group group-name family inet6],
 [edit logical-systems logical-system-name protocols bgp group group-name neighbor address family inet]
 [edit logical-systems logical-system-name protocols bgp group group-name neighbor address family inet6]
 [edit logical-systems logical-system-name protocols bgp group group-name neighbor address family inet labeled-unicast],
 [edit logical-systems logical-system-name protocols bgp group group-name neighbor address family inet6 labeled-unicast],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp family inet],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp family inet6],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp family inet labeled-unicast],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp family inet6 labeled-unicast],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group  group-name family inet],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group  group-name family inet6],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name family inet labeled-unicast],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name family inet6 labeled-unicast],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet6],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet labeled-unicast],
 [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet6 labeled-unicast],
 [edit protocols bgp family inet],
 [edit protocols bgp family inet6],
 [edit protocols bgp family inet labeled-unicast],
 [edit protocols bgp family inet6 labeled-unicast],
 [edit protocols bgp group group-name family inet],
 [edit protocols bgp group group-name family inet6],
 [edit protocols bgp group group-name family inet labeled-unicast],
 [edit protocols bgp group group-name family inet6 labeled-unicast],
 [edit protocols bgp group group-name neighbor address family inet],
 [edit protocols bgp group group-name neighbor address family inet6],
 [edit protocols bgp group group-name neighbor address family inet labeled-unicast],
 [edit protocols bgp group group-name neighbor address family inet6 labeled-unicast],
 [edit routing-instances routing-instance-name protocols bgp family inet],
 [edit routing-instances routing-instance-name protocols bgp family inet6],
 [edit routing-instances routing-instance-name protocols bgp family inet labeled-unicast],
 [edit routing-instances routing-instance-name protocols bgp family inet6 labeled-unicast],
 [edit routing-instances routing-instance-name protocols bgp group group-name family inet],
 [edit routing-instances routing-instance-name protocols bgp group group-name family inet6],
 [edit routing-instances routing-instance-name protocols bgp group group-name family inet labeled-unicast],
 [edit routing-instances routing-instance-name protocols bgp group group-name family inet6 labeled-unicast],
 [edit routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet],
 [edit routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet6],
 [edit routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet labeled-unicast],
 [edit routing-instances routing-instance-name protocols bgp group group-name neighbor address family inet6 labeled-unicast]

Description

   The aigp statement enables the Accumulated IGP (AIGP) BGP attribute on a
   specified protocol family. Configuring AIGP on a particular family enables
   the sending and receiving of the AIGP attribute for that family. AIGP is
   supported for the following address families:

     * IPv4 unicast

     * IPv6 unicast

     * Labeled unicast

   This functionality allows BGP to select paths based on IGP metrics,
   facilitating optimal routing decisions across different autonomous systems
   and enhancing network performance.

   The AIGP attribute enables deployments in which a single administration
   can run several contiguous BGP autonomous systems (ASs). Such deployments
   allow BGP to make routing decisions based on the IGP metric. With AIGP
   enabled, BGP can select paths based on IGP metrics. This enables BGP to
   choose the shortest path between two nodes, even though the nodes might be
   in different ASs. The AIGP attribute is particularly useful in networks
   that use tunneling to deliver a packet to its BGP next hop. Such is the
   case with MPLS label-switched paths.

Options

   disable - Explicitly disables AIGP.

     * Default: Disabled, meaning that the device does not send an AIGP
       attribute and silently discards a received AIGP attribute.

Required Privilege Level

   routing - To view this statement in the configuration.

   routing-control - To add this statement to the configuration.

Release Information

   Not all features and commands are available on all platforms. Use Feature
   Explorer at https://apps.juniper.net/feature-explorer/ to confirm platform
   and release support for specific features.

   Statement introduced in Junos OS Release 12.1.

  Related Documentation

     * Example: Configuring the Accumulated IGP Attribute for BGP
     * aigp-originate

admin@R1> 
```

```
admin@R1> help syslog RPD_OSPF_NBRDOWN  
Name:          RPD_OSPF_NBRDOWN
Message:       OSPF neighbor <neighbor-address> (realm <realm-name> <interface-name> area <area-id>i) state
               changed from <old-state> to <new-state> due to <event-name> (event reason: <reason>)
Help:          OSPF neighbor adjacency was terminated
Description:   An OSPF adjacency with the indicated neighboring router was terminated. The local router no
               longer exchanges routing information with, or directs traffic to, the neighboring router.
Type:          Event: This message reports an event, not an error
Severity:      notice
Facility:      LOG_DAEMON
Action:        For more information, see KB19074.

```

\
Another little trivia item to know about is the `help tip cli` command, which gives you a random CLI tip each time you run it:

```
admin@R1> help tip cli 
JUNOS tip:
Use the 'request system logout' command to forcibly log a user out of
the router.
```

</details>

### Further Reading

<https://www.juniper.net/documentation/us/en/software/junos/cli/topics/topic-map/online-help.html>

<https://supportportal.juniper.net/s/article/JUNOS-How-to-quickly-find-a-CLI-command-if-the-exact-syntax-is-not-known>

<https://www.networkworld.com/article/2094983/using-the-apropos-command-on-linux.html>

<https://youtu.be/jffeYfx24vM?list=PLDQaRcbiSnqHAGz-wapjtd3zQxUg-a8dU&t=99>

<https://studfile.net/preview/2919991/page:7/>
