Professional Documents
Culture Documents
Cli Juniper
Cli Juniper
www.juniper.net
Agenda
Command-Line Interface
CLI Configuration
Moving around Hierarchy
Modify, View, Review & Remove
Activate, Save, Load & Commit
Slide 2
Agenda
Command-Line Interface
Overview
Universal access to router
Console
Management port, using Telnet, ssh, RADIUS, TACACS+
User authentication using login name and password
Users have individual accounts
Per-user command class permissions
Line editor with command history
Context-sensitive help
Command completion
UNIX-style pipes
Copyright 2003 Juniper Networks, Inc.
www.juniper.net
Overview
Configure
Object-based hierarchy
Commit changes when done
Rollback if necessary
Load/save configuration files
Monitor
show command hierarchy
Troubleshoot
Traceroute
Ping
Log and trace file monitoring
www.juniper.net
Overview
Command hierarchy
Less Specific
clear
configure
monitor
set
show
brief
exact
protocol
table
terse
More Specific
www.juniper.net
Log In
Example session
lab2 (ttyd0)
login: perkins
Password:
Last login: Fri Feb 18 19:23:16 on ttyd0
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California.
---JUNOS 4.0R1 built 2000-02-10 09:29:44 UTC
perkins@lab2>
www.juniper.net
Log In
# cli
root@lab2> quit
# logout
lab2 (ttyd0)
login:
www.juniper.net
Log In
Special treatment for root login
Can only log in as root from console port
Must create additional user with superuser
privileges to log in via network ports
Be sure to review security implications
www.juniper.net
Edit Lines
Ctrl-F
Ctrl-A
To beginning of line
Ctrl-E
To end of line
Delete characters
Delete or
backspace key
Ctrl-D
Ctrl-K
Ctrl-U
Ctrl-W
www.juniper.net
10
Edit Lines
Other keys
Ctrl-L
Ctrl-P
Ctrl-N
www.juniper.net
11
Edit Lines
Command completion saves typing
Typing entire command not necessary
Type the minimum characters required and press space or tab key
Completion example
root@lab2> sh<space>ow i<space>
'i' is ambiguous.
Possible completions:
igmp
interfaces
isis
root@lab2> show i
www.juniper.net
12
Agenda
Command-Line Interface
Interpret Output
Error messages
^ displayed under error
Message indicates type of error
Example
[edit]
root@lab2# load config-file<Enter>
^
syntax error, expecting merge, override, or replace.
root@lab2#
www.juniper.net
14
Interpret Output
Output does not scroll off screen
CLI displays ---(more)--- prompt
Important key sequences
Space
Enter
/string
www.juniper.net
15
Get Help
Type ? anywhere on command line
Help depends on where you are
Beginning of line
Shows help for top level of hierarchy
End of command
Shows help for next level in hierarchy
Middle of command
Shows list of matching commands at current level in
hierarchy
www.juniper.net
16
Agenda
Command-Line Interface
CLI Configuration
Moving around Hierarchy
Modify, View, Review & Remove
Activate, Save, Load & Commit
Slide 17
Overview
CLI has separate configuration mode
You edit a copy of current configuration called the
candidate configuration
Changes you make are visible to other CLI users
Changes they make might conflict with your changes
Changes do not take effect until you commit them
When committed, candidate configuration becomes active
and a new candidate is created
www.juniper.net
18
commit
Candidate
configuration
Active
configuration
0
rollback n
...
www.juniper.net
19
[edit]
root@lab2#
www.juniper.net
20
10,000Foot View
Move around statement hierarchy using edit
command
Like UNIX cd command
Alter configuration using set command
Activate configuration using commit command
www.juniper.net
21
top
chassis
firewall
alarm
atm
clock
e3
interfaces
protocols
system
more
fpc
ethernet
sonet
t3
More Specific
www.juniper.net
22
top
chassis
firewall
alarm
atm
clock
e3
interfaces
protocols
system
more
fpc
ethernet
sonet
t3
www.juniper.net
23
www.juniper.net
24
Chassis configuration
> class-of-service
Class-of-service configuration
> firewall
> forwarding-options
> groups
Configuration groups
> interfaces
Interface configuration
> policy-options
> protocols
> routing-options
> snmp
> system
System parameters
[edit]
www.juniper.net
25
> alarm
> clock
Clock sources
> fpc
[edit chassis]
root@lab2#
www.juniper.net
26
ATM alarms
> e3
E3 alarms
> ethernet
Ethernet alarms
> sonet
SONET alarms
> t3
DS3 alarms
[edit chassis]
root@lab2# up
[edit]
Copyrightroot@lab2#
2003 Juniper Networks, Inc.
www.juniper.net
27
[edit]
root@lab2#
www.juniper.net
28
www.juniper.net
29
Agenda
Command-Line Interface
CLI Configuration
Moving around Hierarchy
Modify, View, Review & Remove
Activate, Save, Load & Commit
Slide 30
www.juniper.net
31
www.juniper.net
32
www.juniper.net
33
[edit]
root@lab2# show chassis
filter-check 180;
alarm {
sonet {
lol red;
los red;
pll yellow;
}
}
root@lab2#
Copyright 2003 Juniper Networks, Inc.
www.juniper.net
34
Remove Statements
[edit]
root@lab2# edit chassis alarm sonet
[edit chassis alarm sonet]
root@lab2# delete lol
[edit chassis alarm sonet]
root@lab2# delete los
[edit chassis alarm sonet]
root@lab2#
www.juniper.net
35
Remove Statements
[edit chassis alarm sonet]
root@lab2# up
[edit chassis]
root@lab2#
www.juniper.net
36
Agenda
Command-Line Interface
CLI Configuration
Moving around Hierarchy
Modify, View, Review & Remove
Activate, Save, Load & Commit
Slide 37
Activate a Configuration
Activate configuration changes using the commit
command
[edit]
user@host# commit
commit complete
[edit]
user@host#
www.juniper.net
38
Activate a Configuration
Inband configuration has disadvantages
Might disrupt connectivity to router
Might disrupt inband session
Avoid disadvantages using commit confirmed
command
Activates configuration for a few minutes (default is 10
minutes)
If configuration is not confirmed, router returns to
previous configuration automatically
Confirm configuration by issuing a second commit
command
www.juniper.net
39
www.juniper.net
40
Commit Dual RE
When commit is entered, the system will only activates the
changes in the local RE.
Use commit sync command to make changes to
activates in both RE.
www.juniper.net
41
www.juniper.net
42
www.juniper.net
43
www.juniper.net
44
commit
Candidate
configuration
Active
configuration
0
load
save
rollback n
...
www.juniper.net
45
Configuration
Command Summary
www.juniper.net
46
Prefix
Via
192.168.1.112/30
20 so-1/1/3.0
Miami
so-5/0/0.0
Miami
so-1/1/1.0
Miami
20 so-1/1/3.0
Miami
so-5/0/0.0
Miami
so-1/1/1.0
Miami
192.168.1.116/30
42
42
www.juniper.net
47
www.juniper.net
48
www.juniper.net
49
Hands-On Session
www.juniper.net
50
Hands-on Session 1
JUNOS CLI Familiarization
A : Commands & On-line Help
Type ?
Type c?
Type clear ?
B : Word Completion
Type sh<Space>ow i<Tab>
Type sh<Tab>terfaces
Type con<Space>figure
Type quit
D : Keyboard Sequence
Type show interfaces<dont press enter>
E: Command Output
Type sh inter detail
What happen whens you press space bar?
What happens when you press enter?
Slide 51