Junos CLI Demo v4.5
Junos CLI Demo v4.5
Junos CLI Demo v4.5
John Jacobs
[email protected]
http://www.juniper.net
Agenda
CLI intro
T640 architecture
(presentation)
Juniper Conventions
255.0.0.0 = /8
255.255.0.0 = /16
255.255.255.0 = /24
255.255.255.128 = /25
255.255.255.252 = /30
255.255.255.255 = /32
Juniper Interfaces
fxp1
fxp0
fxp0
fxp2
RE0
fxp1
RE1
fxp2 fxp2
CB0
Switch
CB1
Switch
fxp1
Juniper Interfaces
Loopback Interface
lo0
Loopback zero
Interface Names
Physical
interfaces
have standard names
Type
FPC
slot
PIC slot
Port number
so-5/2/3
An interface must NOT be present in the router to be configured!
type-fpc/pic/port.logical
so-0/0/1.0
PPP
HDLC
Logical interface
descriptors
so-5/2/3.43
10
11
so-0/0/0
so-7/0/0
First FPC
First PIC
First port
Eight FPC
First PIC
First port
so-31/0/0
12
Console/Aux Port
telnet
ssh1/ssh2
13
Operational Mode
14
show version
show ver [press space or tab]
15
Get Help
Beginning of line
Shows
End of command
Shows
Middle of command
Shows
The
16
>
>
>
#
?
show ?
show system ?
set protocols ?
17
help topic ?
help reference ?
Configuration Guide
Command reference
18
19
Command History
20
21
n repeat search
q quit
b previous screen
space next screen
s filename
Enter line
h help
N full listing
G End of file
Example:
show interfaces
/ lo0
22
Overview
Command hierarchy
Less Specific
show
brief
exact
protocol
table
terse
More Specific
23
show cli
set cli
24
25
Interface Commands
show interface
show interface terse
26
Interface Commands
show
interfaces statistics
Display
clear
clear
interface statistics
Zero
27
Misc Commands
request
support information
(like
28
Misc Commands
show version
Display statistics about the amount of free disk space in the routers
file systems.
show system ?
show chassis?
29
Misc Commands
juniper@Yoda> show chassis hardware
Hardware inventory:
Item
Version Part number
Chassis
Midplane
REV 03
710-001950
Power supply A
Rev 04
740-002497
Display
REV 04
710-001995
Host
FEB
REV 12
710-001948
FPC 0
PIC 0
REV 04
750-002992
PIC 1
REV 03
750-003037
PIC 3
REV 01
750-002982
FPC 1
PIC 0
REV 03
750-003037
PIC 2
REV 01
750-002982
PIC 3
REV 01
750-002982
Serial number
58922
HF0581
MC10675
HE8128
b2000007c86cdf01
HA4462
Description
M10
HE1751
HD0421
HF2513
HD0445
AJ2936
AK4006
4x T1, RJ48
1x Tunnel
1x Tunnel
AC
Present
Internet Processor II
30
Date/Time Commands
(YYYYMMDDhhmm.ss)
Display the current time and information about how long the
router, router software, and routing protocols have been running.
31
User Commands
32
Cool Commands
33
Command Pipes
>show interfaces | ?
>show interfaces | count
>show interfaces | match fxp1
>show interfaces | find fxp1
>show interfaces | save filename
>show log bgp.log | match open
>show log bgp.log | no-more
>file show Demo | find fxp1
34
Configuration Mode
35
36
Candidate configuration
Candidate
Configuration
rollback n
Active
Configuration
0
/config/juniper.conf.n (n=0-3)
/var/db/config/juniper.conf.n (n=4-49)
37
49
38
configure command
user@host> configure
Entering configuration mode
[edit]
user@host#
39
exit command
40
set command
41
show command
In config mode:
show interfaces
Shows the interfaces section of the config
In CLI mode:
show interfaces
Shows the the state of the interfaces on the
router
42
show command
#show
#show system
#show interfaces
#show interfaces fxp1
#show routing-options
#show protocols
43
delete command
44
Less Specific
top
alarm
atm
clock
e3
fpc
ethernet
sonet
t3
More Specific
45
alarm
atm
clock
e3
fpc
ethernet
sonet
t3
46
edit command
Example:
#top
#show
#edit interfaces
#show
#top
Edit ?
Juniper Networks, Inc. Copyright
47
top
Example:
#edit interfaces
#show
#top
#show
48
up
Example:
49
Example:
#edit system login
#show
#exit
#show
50
commit command
51
52
53
and so on
54
Configure Example
>configure
#show
#set system host-name Dallas
#show
#show system
#commit
#exit
55
Configure Example
>configure
#edit system
#show
#set host-name LA
#show
#up
#show
#commit
#show
#rollback 1
#show
#commit
#exit
56
status command
>configure exclusive
>configure private
57
save command
save filename
saves the configuration to an ASCII file on
hard drive, floppy drive, ftp site,
58
>show
>show
>show
>show
configuration
configuration
configuration
configuration
system
interfaces
routing-options
protocols
59
Active configuration
Rollback configuration
Any saved configuration file
60
Syntax
61
Copy
62
Candidate
configuration
Active
configuration
0
load
save
rollback n
...
63
OR
>configure
#delete
#show
#rollback
#show
64
run command
65
rename command
66
rename command
[edit]
juniper@R16# show interfaces
so-1/2/3 {
unit 0 {
family inet {
address 1.1.1.1/24;
}
}
}
[edit]
juniper@R16# rename interfaces so-1/2/3 to so-2/2/3
[edit]
juniper@R16# show interfaces
so-2/2/3 {
unit 0 {
family inet {
address 1.1.1.1/24;
}
}
}
67
Configuration
Command Summary
rollback command
commit command
show command
delete command
status command
68
69
Filenames
70
Filenames
path/filename
ftp://hostname/path/filename
hostname/path/filename or scp://hostname/path/filename
a:filename or a:path/filename
/var/filename or /var/path/filename
File in the users home directory on the local hard disk. This is the default.
http://hostname/path/filename
71
File Commands
file ?
file list
List of files
(remember, default is your home directory)
72
File Commands
73
ftp
ftp 10.1.1.101
bi
hash
lcd
/var/tmp
get JUNOSfilename
74
Periodic Configuration
Uploads
Configuration:
system {
archival {
configuration {
transfer-interval <minutes>;
transfer-on-commit;
archive-sites {
ftp://dump:[email protected]/pub/incoming/config;
ftp://no:[email protected]/pub/blah
}
}
}
}
75
76
77
Syslog Facilities
anyAny facility
authorizationAuthorization system
cronCron daemon
daemonVarious system daemons
interactive-commandsCLI commands
kernelMessages generated by the JUNOS kernel
userMessages from random user processes
78
Syslog Levels
79
Syslog Levels
More severe
80
Syslog Options
Writing to a file
file filename {
facility level;
archive {
files number;
size size;
(world-readable | no-world-readable);
}
}
81
Types of Syslog
Write to a host
Write to a user
host hostname {
facility level;
}
user (username | *) {
facility level;
}
console {
facility level;
}
82
Syslog Example
syslog {
/* send all security-related information to file "security" (/var/log/security) */
file security {
authorization info;
interactive-commands info;
}
/* send generic messages (authorization at level notice and above,
the rest at level warning and above) to file "messages" */
file messages {
authorization notice;
any warning;
}
/* send any critical messages to alex if he is logged in */
user alex {
any critical;
}
/* send all daemon, level info and above, or anything, warning and above, to
hot-dog.juniper.net */
host hot-dog.juniper.net {
daemon info;
any warning;
}
/* send any error messages, or higher, to the system console */
console {
any error;
}
}
83
Types of Tracing
84
General Tracing
[no-stamp];
85
Trace Options
86
Example:
#edit protocols ospf
#set traceoptions file ospf.log
#set traceoptions flag ?
Possible completions:
all
database-description
error
event
flooding
general
hello
lsa-ack
lsa-request
lsa-update
normal
packet-dump
packets
policy
route
spf
state
task
timer
Trace everything
Trace database description packets
Trace errored packets
Trace OSPF state machine events
Trace LSA flooding
Trace general events
Trace hello packets
Trace LSA acknowledgement packets
Trace LSA request packets
Trace LSA update packets
Trace normal events
Dump the contents of selected packet types
Trace all OSPF packets
Trace policy processing
Trace routing information
Trace SPF calculations
Trace state transitions
Trace routing protocol task processing
Trace routing protocol timer processing#set traceoptions flag all
#commit and-quit
>monitor start ospf.log
Watch for messages
>monitor stop
87
Example:
#edit protocols isis
#set traceoptions file isis.log
#set traceoptions flag ?
Possible completions:
all
csn
error
general
hello
lsp
lsp-generation
normal
packets
policy
psn
route
spf
state
task
timer
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
everything
Complete Sequence Number packets
errored packets
general events
Hello packets
Link State packets
LSP generation
normal events
IS-IS packets
policy processing
Partial Sequence Number packets
routing information
SPF events
state transitions
routing protocol task processing
routing protocol timer processing#commit and-quit
#commit and-quit
>monitor start isis.log
Watch for messages
>monitor stop
88
Example:
#edit protocols bgp
#set traceoptions file bgp.log
#set traceoptions flag ?
Possible completions:
all
aspath
damping
general
keepalive
normal
open
packets
policy
route
state
task
timer
update
Trace everything
normal events
BGP open packets
all BGP protocol packets
policy processing
routing information
state transitions
routing protocol task processing
routing protocol timer processing
BGP update packets#commit and-quit
#commit and-quit
>monitor start bgp.log
Watch for messages
>monitor stop
89
Example:
#edit interfaces
#set traceoptions file interface.log
#set traceoptions flag ?
Possible completions:
all
Enable all interface trace flags
event
Trace interface events
ipc
Trace interface IPC messages
media
Trace interface media changes
#commit and-quit
>monitor start interface.log
Watch for messages
>monitor stop
(can also enable different flags per specific interfaces)
90
Example:
#edit protocols routing-options
#set traceoptions file generalrouting.log
#set traceoptions flag ?
Possible completions:
all
config-internal
general
normal
parse
policy
regex-parse
route
state
task
timer
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace
Trace everything
configuration internals
general events
normal events
configuration parsing
policy processing
regular-expression parsing
routing information
state transitions
routing protocol task processing
routing protocol timer processing#commit and-quit
#commit and-quit
>monitor start generalrouting.log
Watch for messages
>monitor stop
91
>show log
list of log files in /var/log
92
Monitor Options
93
Monitor Options
>monitor stop
Stop monitoring all log files
Like Cisco no debug all
>monitor list
94
Log Files
>show log
more filename
95
JUNOS Software
96
JUNOS Software
Flash drive
Hard drive (alternate copy)
PCMCIA flash card (use as a last resort)
If flash drive fails, router can still boot from hard drive or
removable media
Upgradable
97
Boot Sequence
Hardware controlled
Removable
media
Success?
Done
Solid-state
flash disk
Rotating
disk
Success?
Done
Halt
Success?
Done
98
99
JUNOS Software
100
jbundle vs jinstall
101
Package-m.nZnumber.tgz
Alpha
B- Beta
R Release
I Internal Test or Experimental
102
jinstall-7.3R1.2-domestic.tgz
103
/altroot
the root file system (/) is backed up to /altroot
/altconfig
/config directory is backed up to /altconfig.
104
105
Software Upgrade
Example:
106
Software Upgrade
ftp 10.1.1.101
bi
hash
lcd
/var/tmp
get JUNOSfilename
107
Software Upgrade
7.3R1.2-domestic-signed.tgz
108
Software Upgrade
109
110
Powerup
Power down
Reboot
111
112
root login
Root password
113
Initial Configuration
Root password
Router name
Management interface (fxp0) IP address and
prefix length
Default route
DNS server IP address
Turn on ssh or telnet or ftp
114
Initial Configuration
115
Initial Configuration
116
Initial Configuration
117
Initial Configuration
118
host-name Denver
domain name juniper.net
services telnet
services ftp
119
>set date
120
References
http://www.juniper.net/products/
http://www.juniper.net/solutions/
Juniper Products
http://www.juniper.net/company/presscenter/imagelibrary/library.h
tml
Image Library
121
References
Configuration guide:
Installation and system management
www.juniper.net/support
www.juniper.net/techpubs
www.juniper.net/techpubs/qrc/
122
www.juniper.net
http://www.juniper.net/gainaccess.htm
123
JTAC Resources
JTAC
Contact Information
support: [email protected]
Phone support for U.S. customers and
Partners: 888-314-JTAC (5822)
Phone support for international
customers: 408-745-2121
Juniper.net Case Manager: (
http://www.juniper.net/support/)
124
Certification Statistics
http://www.juniper.net/training/certification/
125
Thank you!
John Jacobs
[email protected]
http://www.juniper.net