Juniper Cheat Sheet
Juniper Cheat Sheet
17
Description
clear
configure
file
Perform file manipulation operations, such as copy, delete, list, rename, and show.
Syntax: file (compare | copy | delete | list | rename | show)
help
monitor
mtrace
ping
Verify IP connectivity to another IP host or Asynchronous Transfer Mode (ATM) connectivity (ping ATM)
using Operation Administration and Maintenance (OAM) cells to an ATM endstation.
Syntax: ping host <interface source-interface> <bypass-routing> <count requests> <do-not-fragment> <interval
seconds> <pattern string> <record-route> <routing-instance routing-instance-name> <size bytes> <strict> <tos
type-of-service> <ttl value> <via route> <rapid | detail>
Syntax: ping atm interface interface <count count> <end-to-end | segment> <interval interval>
<sequence-number sequence-number> <vci vci> <brief>
quit
request
Make system-level requests, such as halt or reboot the router, load software packages, and back up the
routers file systems.
Syntax: request system (halt | reboot | snapshot | software)
restart
set
Set CLI properties, the routers date and time, and the craft interface display text.
Syntax: set (chassis | cli | date)
18
Command
Description
show
Show information about all aspects of the software, including interfaces and routing protocols.
Syntax: show (accounting | aps | arp | as-path | bgp | chassis | cli | configuration | connections | dvmrp | firewall
| helper | host | igmp | ike | ilmi | interfaces | ipsec | ipv6 | isis | l2circuit | l2vpn | ldp | link-management | log |
mpls | msdp | multicast | ntp | ospf | pfe | pim | policer | policy | rip | ripng | route | rsvp | sap | snmp | system |
task | ted | version | vrrp)
ssh
start
telnet
test
traceroute
19
Description
activate
Remove the inactive: tag from a statement, effectively reading the statement or identifier to the
configuration. Statements or identifiers that have been activated take effect when you next issue the commit
command.
Syntax: activate (statement-path | identifier)
annotate
commit
Commit the set of changes to the database and cause the changes to take operational effect.
Syntax: commit <and-quit> <check> <confirmed <minutes>> <synchronize>
copy
deactivate
Add the inactive: tag to a statement, effectively commenting out the statement or identifier from the
configuration. Statements or identifiers marked as inactive do not take effect when you issue the commit
command.
Syntax: deactivate (statement-path | identifier)
delete
Delete a statement or identifier. All subordinate statements and identifiers contained within the specified
statement path are deleted with it.
Syntax: delete (statement-path | identifier)
edit
Move inside the specified statement hierarchy. If the statement does not exist, it is created.
Syntax: edit <statement-path>
exit
Exit the current level of the statement hierarchy, returning to the level prior to the last edit command, or exit
from configuration mode. The quit and exit commands are synonyms.
Syntax: exit <configuration-mode>
help
insert
load
Load a configuration from an ASCII configuration file or from terminal input. Your current location in the
configuration hierarchy is ignored when the load operation occurs.
Syntax: load (merge | override | replace ) (filename | terminal)
20
Command
Description
quit
Exit the current level of the statement hierarchy, returning to the level prior to the last edit command, or exit
from configuration mode. The quit and exit commands are synonyms.
Syntax: quit <configuration-mode>
rename
rollback
Return to a previously committed configuration. The software saves the last 10 committed configurations,
including the rollback number, date, time, and name of the user who issued the commit configuration
command. rollback 0 erases any configuration changes made to the current candidate configuration.
The currently operational JUNOS software configuration is stored in the file juniper.conf, and the last three
committed configurations are stored in the files juniper.conf.1.gz, juniper.conf.2.gz, and juniper.conf.3.gz.
These four files are located in the directory /config/, which is on the routers flash drive. The remaining six
previous committed configurations, the files juniper.conf.4.gz through juniper.conf.9.gz, are stored in the
directory /var/db/config/, which is on the routers hard disk.
Syntax: rollback <number>
run
Run an operational mode CLI command without exiting from configuration mode.
Syntax: run <operation-command>
save
Save the configuration to an ASCII file in the users home directory (by default) or to the users terminal
session. The statement hierarchy and the contents of the current level of the statement hierarchy (and
below) are saved. This allows a section of the configuration to be saved, while fully specifying the statement
hierarchy.
Syntax: save filename | terminal
set
Create a statement hierarchy and set identifier values. This is similar to the edit command except that your
current level in the hierarchy does not change, and you can set identifier values, while the edit command
only allows access to a statement path.
Syntax: set (statement-path | identifier )
show
status
top
Return to the top level of configuration command mode, indicated by the [edit] banner, or execute a
command from the top level of the configuration.
Syntax: top <configuration-command>
up
update
Update a private database. For more information on the update command, see the JUNOS System Basics and
Services Command Reference.
Syntax: update
21
Action
You can create a file, copy the file to the local router, and then load the file into the
CLI. After you have loaded the file, you can commit it to activate the configuration
on the router, or you can edit the configuration interactively using the CLI and
commit it at a later time.
To load a configuration from a file, follow these steps:
1. Create the configuration in a file using a text editor such as Notepad, making
sure that the syntax of the configuration file is correct. See JUNOS Internet
Software Protocols, Class of Service, Chassis, and Management Command
Reference, for information about testing the syntax of a configuration file.
2. In the text file, use an option to perform the required action. The following table
lists and describes some options. For an example of a text file, see What It
Means.
Table 12: Options for the load Command
merge
override
replace
Searches for the replace tags, deletes the existing statements of the same
name, if any, and replaces them with the incoming configuration. If there is
no existing statement of the same name, the replace operation adds the
statements marked with the replace tag to the configuration.
Note: For this operation to work, you must include replace tags in the text file
or configuration you type at the terminal.
3. Enter Ctrl+a to select all the text, and Ctrl+c to copy the contents of the text file
to the clipboard.
22
6. At the prompt, paste the contents of the clipboard using the mouse and the
paste icon.
[edit]
user@host# load merge terminal
[Type ^D at a new line to end input]
> Paste the contents of the clipboard here<
7. Hit Enter.
8. Enter Ctrl+d.
9. Commit the configuration to activate it on the router, or you can edit the
configuration interactively using the CLI and commit it at a later time.
Sample Output
23
What It Means
The sample output shows a configuration loaded from a text file with the replace
option. For more information about loading a configuration, see the JUNOS System
Basics Configuration Guide.
Action
24
4. Copy each line of the configuration individually from the local router to the
target router. In the target router, you must be at the top level of the
configuration and in configuration mode. For example:
mwazna@R2> edit
Entering configuration mode
[edit]
mwazna@R2# set interfaces so-0/0/0 unit 0 family inet accounting
destination-class-usage
25
26
Keyboard sequence
Action
Ctrl+b
Esc+b or Alt+b
Ctrl+f
Esc+f or Alt+f
Ctrl+a
Ctrl+e
Ctrl+d
Ctrl+k
Delete the all characters from the cursor to the end of the command line.
Ctrl+u or Ctrl+x
Esc+d or Alt+d
Ctrl+y
Ctrl+l
Ctrl+p
Ctrl+n
Ctrl+r
Search the CLI history incrementally in reverse order for lines matching the
search string.
Esc+/ or Alt+/
Search the CLI history for words for which the current word is a prefix.
Action
Space or Ctrl+f
Ctrl+e or g
n (or no-more)
or Ctrl-u
or Ctrl-b
Ctrl-a or g
/string
?string
Find a text string. You are prompted for the string to match
Find, ignoring a text string. You are prompted for the string to ignore.
Ctrl-C, q, Q, or Ctrl-k
Hold the CLI at the More prompt after displaying all output.
c or C
Ctrl-l
Save the command output to a file. You are prompted for a filename.
27
28