You are on page 1of 66

Junos

JUNOS CLI

Cathy Gadecki Michael Scruggs

JUNOS

JUNOS CLI
Cathy Gadecki Michael Scruggs

1 CLI ............................................................................... 1
2 ....................................................................................... 7
3 ............................................................... 23
4 ................................................................ 31
........................................................................................................ 57

ii

JUNOS CLI

2009 by Juniper Networks, Inc.

Juniper NetworksJuniper Networks


JUNOSNetScreen ScreenOS Juniper
Networks, Inc.
JUNOSe Juniper Networks, Inc.

Cathy Gadecki Juniper Networks


JUNOS
JUNOS for Dummies
JUNOS
Michael Scruggs Juniper Networks

Juniper Networks
Juniper Networks
Juniper Networks
Juniper
Networks
5,473,5995,905,7255,909,440
6,192,0516,333,6506,359,4796,406,312
6,429,7066,459,5796,493,3476,538,518
6,538,8996,552,9186,567,9026,578,186
6,590,785

Juniper Networks
Vervante.com
Nancy Koerbel
Ames & Eames, Inc.

2 2009 4

Patrick Ames

Nancy
Koerbel Susan
Harris
Jonathan Looney Michael Bushong
Jeff Mattan
Juniper
Networks Juniper Networks

Michelle Bhatia Bernadette Willis

iii

JUNOS CLI
JUNOS CLI Juniper
Networks

JUNOS
JUNOS Juniper Networks FreeBSD
carrier-grade

Juniper Networks

IT

iv

JUNOS


Juniper

JUNOS

JUNOS CLI


www.juniper.net/techpubs/

JUNOS CLI
CLI
JUNOS

P
JUNOS CLI

P
showset delete
P
JUNOS commit
P

JUNOS CLI JUNOS


JUNOS
JUNOS Juniper
JUNOS

dayone@juniper.net

vi

...
JUNOS

null modem rollover Juniper



Juniper

root Enter

host (ttyd0)
login: root
password:

3 CLI

UNIX shell CLI


cli
root@Amnesiac% cli

user@Amnesiac > show i?

i ...
configure

1
CLI

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
. . . . . . . . . . . . . . . . . . . . . . . . . . .4

JUNOS CLI

(Command-Line InterfaceCLI)

JUNOS CLI

JUNOS ( )

J-Web
GUI CLI J-Web
JUNOS
J-Web

www.juniper.net/techpubs/ J-Web

JUNOS CLI
n

1 CLI

1.1

JUNOS CLI
JUNOS CLI 1.1

JUNOS CLI JUNOS


JUNOS CLI

CLI CLI
1.2 CLI show
show configuration access
chassisfirewallgroups
CLI

JUNOS CLI

1.2

UNIX (\)
UNIX PC Mac
3

1.3
system interfaces

1.3

1 CLI

n
n

JUNOS CLI
[edit]
system {
services {
ftp;
}
}

1. [edit]
2. CLI
3. CLI ({ }) system
services (cascading)
4. CLI (;) ftp;

JUNOS CLI

[edit] [edit]
[edit system services]
1 2 system 3
services
FTP
ftp;
system services
[edit]

system {
services {
ftp;
}
}

ftp;
system services
ftp;
[edit system services]
ftp;

4
CLI CLI
JUNOS

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
. . . . . . . . . . . . . . . . . . . . . . .9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
More . . . . . . . . . . . . . . . .15
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21

JUNOS CLI

CLI


CLI
URL
CLI

CLI


www.juniper.net/techpubs/

1.
2. JUNOS
telnet gatewayserver
user: username
password: password

3.
telnet routername
user: username
password: password

IP DNS

IP

(>) (#)
configure
mike@juniper1> configure

configure co
CLI

exit
exit

configuration-mode

mike@junper1# exit

JUNOS CLI

JUNOS Unix
CLI

CLI
( VT100 )

10

JUNOS CLI

Down arrow or Ctrl+n

Up arrow or Ctrl+p

Ctrl+a

Ctrl+e

Ctrl+b

Ctrl+f

Esc+f

Esc+b

Ctrl+d

Esc+d

Esc+backspace

Ctrl+k

Ctrl+u

Ctrl+y

CLI

CLI Tab CLI

IP Tab

[edit]
mike@juniper1# show i<space>
i is ambiguous

Possible completions:
igmp Show Internet Group Management Protocol
ike Show Interface Key Exchange Information
interfaces Show Interface Information
ipsec Show IP Security Information
isis Show Intermediate System-to Intermediate

( sh int,) JUNOS
mike@juniper1> sh<space>ow int<enter>

Tab

sh<space>ow ro<space>ute
sh<space>ow ch<space>assis h<space>ardware
sh<space>ow conf<space>iguration
cl<space>ear rip s<space>tastics
res<space>tart ro<space>uting g<space>racefully

JUNOS CLI
CLI
Juniper

(?)
?
? JUNOS

[edit system]
mike@juniper1# set s?
Possible completions:

saved-core-context

saved-core-files

Save context information for core files


Number of saved core files per executable (1..64)

11

12

JUNOS CLI

> services
System services
> static-host-mapping Static hostname database mapping
> syslog
System logging facility

show ?
show chassis ?
show interfaces ?
show system ?
request ?
request support ?
restart ?
ping ?
traceroute ?

s ?
show i ?
request system s ?
restart s ?

mike@juniper1> request system license add ?


Possible completions:
<filename> Filename (URL, local, remote, or floppy)
file1
Size: 19701, Last changed: Feb 23 21:56:52
file2
Size: 1835, Last changed: Apr 09 09:51:57
log1
Size: 1215, Last changed: Feb 16 13:07:49
log2
Size: 1135, Last changed: Apr 09 11:05:16
terminal
Use login terminal

mike@junper1> request system license add /cf/ ?


Possible completions:
<[Enter]>
Execute this command
<filename>
Filename (URL, local, remote, or floppy)
/cf/boot/
Last changed: Apr 16 11:08:56
/cf/dev/
Last changed: Apr 08 2004
/cf/etc/
Last changed: Apr 30 08:40:09
/cf/kernel
Size: 32797835, Last changed: Apr 15
/cf/kernel.old Size: 32715591, Last changed: Nov 09

/cf/opt/
Last changed: Nov 09 02:08:43
/cf/packages/ Last changed: Apr 16 11:08:57
/cf/root/
Last changed: Apr 16 11:08:56
/cf/sbin/
Last changed: Apr 16 11:08:56
/cf/usr/
Last changed: Nov 09 02:11:23
/cf/var/
Last changed: Nov 09 02:11:23

help
JUNOS Juniper

n help apropos

n help reference
n help syslog syslog
n help tip CLI
n help topic

help apropos
help apropos

[edit]
mike@junper1# help apropos host-name
set system host-name <host-name>
Hostname for this router
set system static-host-mapping <host-name>
Fully qualified name of system
set system services dhcp static-binding <mac-address> host-name <host-name>

13

14

JUNOS CLI

Hostname for this client


set system syslog host
Host to be notified
set interfaces <interface_name> services-options syslog host <host-name>
Name of host to notify
set accounting-options routing-engine-profile <profile-name> fields host-name
Hostname for this router
set services l2tp tunnel-group <name> syslog host <host-name>
Name of host to notify
set services service-set <service-set-name> syslog host <host-name>
Name of host to notify

(" ")
help topic
help

topic

mike@juniper1> help topic interfaces address ?


Configuring the Interface Address
You assign an address to an interface by specifying the address when configuring the
protocol family. For the inet family, you configure the interfaces IP address. For the
iso family, you configure one or more addresses for the loopback interface. For the
ccc, tcc, mpls, tnp, and vpls families, you never configure an address.

help reference
help reference

mike@juniper1> help reference interfaces address


address
Syntax
address address {
arp ip-address (mac | multicast-mac) mac-address <publish>;
broadcast address;
destination address;
destination-profile name;
eui-64;
multipoint-destination address dlci dlci-identifier;
...
Hierarchy Level

[edit interfaces interface-name unit logical-unit-number family family],

[edit logical-routers logical-router-name interfaces interface-name unit


logical-unit-number family family]
Description
Configure the interface address.
<...>

help reference Unix manpages

manual

JUNOS
ReturnCLI

CLI

show JUNOS
[edit]
mike@juniper1# show
protocols {
pim {
interface so-0/0/0 {
priority 4;
version 2;
# Warning: missing mandatory
statement(s): 'mode'
}
}
}

More
(|) more CLI

15

16

JUNOS CLI

(|)

CLI

mike@juniper1> show route | ?


Possible completions:
count Count occurrences
display Show additional kinds of information
except Show only text that does not match a pattern
find Search for first occurrence of pattern
hold Hold text without exiting the --More-- prompt
last Display end of output only
match Show only text that matches a pattern
no-more Dont paginate output
request Make system-level requests
resolve Resolve IP addresses
save Save output text to file
trim Trim specified number of columns from start of line

request support information


&lt;filename&gt;
mike@juniper1> request support information | save <filename>
Wrote 1143 lines of output to filename

CLI
n |

count

mike@juniper1> show interfaces terse | count


Count: 22 lines

n | display detail (
)
XML

XML
XML

(RPC)

n |

display xml XML

mike@juniper1> show cli directory | display xml


<rpc-reply xmlns:junos= http://xml.juniper.net/
junos/9.410/junos>
<cli>
</cli>
<cli>
<banner<master:0></banner>
< /cli>
</rpc-reply>

n |

hold

(|)
n |

match

mike@juniper1 > show configuration | match at at-2/1/0 {


at-2/1/1 {
at-2/2/0 {
at-5/2/0 {
at-5/3/0 {

Match UNIX grep

n |

except

mike@juniper1> show system users | except root


8:28PM up 1 day, 13:59, 2 users, load averages:
0.01, 0.01, 0.00
USER TTY FROM
LOGIN@ IDLE WHAT
sheep p0 baa.juniper.net 7:25PM - cli

n |

find

17

18

JUNOS CLI

mike@juniper1>show ethernet-switching interfaces detail | find Index: 80


Interface: ge-0/0/16.0 Index: 80
State: down
VLANs:
default
untagged
blocked - blocked by STP
Interface: ge-0/0/17.0 Index: 81
State: down
VLANs:
default
untagged

n |

blocked - blocked by STP


last

find match

JUNOS AND


Ethernet
mike@juniper1> show interfaces terse | match fe- | count
Count: 12 lines

10.0
/32
mike@juniper1> show route | match /32 | match 10.0
10.0.15.2/32
*[Local/0] 03:18:28
10.0.16.1/32
*[Local/0] 03:20:49
10.0.0.4/32
*[Local/0] 08:54:55
192.168.10.0/32
*[Local/0] 08:57:26

More
CLI 24

(more)
(more) h

mike@juniper1> show ethernet-switching interfaces detail


Interface: ge-0/0/0.0 Index: 64
State: down
VLANs:
default
untagged
blocked - blocked by STP
*// Data Deleted From Example //*
Interface: ge-0/0/12.0 Index: 76
State: down
VLANs:
default
untagged

blocked - blocked by STP

---<more>--- h
---(Help for CLI automore)--
Clear all match and except strings: c or C
Display all line matching a regexp
m or M <string>
Display all lines except those matching a regexp: e or E <string>
Display this help text:
h
Dont hold in automore at bottom of output:
N
Hold in automore at bottom of output:
H
Move down half display:
TAB, d, or ^D
Move down one line:
Enter, j, ^N, ^X, ^Z, or Down-Arrow
Move down one page:
Space, f, ^F, or Right-Arrow
Move to bottom of output:
G, ^E, or End
Move to top of output:

g, ^A, or Home
Move up half display:

u or ^U
Move up one line:
k, Delete, Backspace, ^P, or Up-Arrow
Move up one page:
b, ^B, or Left-Arrow
Quit automore:
q, Q, ^K
Redraw display:
^L or ^R
Repeat a keystroke command 1 to 9 times:
Meta-1..9
Repeat last search:
n
Save output to a file:

s or S <filename/url>
Search backwards thru the output:
?<string>
Search forwards thru the output:
/<string>
---(End of Help)---

set cli screen-length


| no-more

19

20

JUNOS CLI

Unix Unix

JUNOS C
CLI

Bourne

CLI

mike@juniper1> ( )
mike@juniper1# ( )

CLI
start shell C

CLI
CLI cli
% cli

CLI

C
CLI C start

shell

mike@juniper1> start shell

CLI C run

mike@juniper1# run start shell

start shell

CLI
run
run

Bourne C csh
$ csh

Bourne
CLI Bourne start

shell

mike@juniper1> start shell

CLI C run

start shell sh

mike@juniper1# run start shell sh

C C sh
% sh

CLI CLI

mike@junper1> exit
logout
Connection closed by foreign host.
$

21

22

JUNOS CLI

[edit protocols ospf]


mike@juniper1# exit configuration-mode
Exiting configuration mode
mike@juniper1> exit
logout
Connection closed by foreign host.
$

( )

( )

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
. . . . . . . . . . . . . . . . . . . . . . . . . . . .29

24

JUNOS CLI

n
n
n
n
n
n CLI
n
JUNOS
JUNOS

Juniper
SNMP

JUNOS
www.juniper.net/dayone

mike@juniper1>?
Possible completions:
clear
Clear information in the system
configure
Manipulate software configuration information
file
Perform file operations
help
Provide help information
monitor Show real-time debugging information
ping
Ping remote target
quit
Exit the management session
request
Make system-level requests
restart
Restart software process
set
Set CLI properties, date/time, craft interface message
show
Show system information
ssh
Start secure shell on another host
start Start shell
telnet

Telnet to another host
test Perform diagnostic debugging
traceroute
Trace route to remote host
<. . .>

mike@juniper1> show?
Possible completions:
accounting Show accounting profiles and records
aps Show Automatic Protection Switching information
arp Show system Address Resolution Protocol table entries
as-path Show table of known autonomous system paths
bfd Show Bidirectional Forwarding Detection information
bgp Show Border Gateway Protocol information
chassis Show chassis information
class-of-service Show class-of-service (CoS) information
cli Show command-line interface settings
configuration Show current configuration
connections Show circuit cross-connect connections
dialer Show dialer information
dlsw Show DLSw information
dvmrp Show Distance Vector Multicast Routing Protocolinformation
dynamic-tunnels Show dynamic tunnel information information
esis Show end system-to-intermediate system information
firewall Show firewall information
helper Show port-forwarding helper information
host Show hostname information from domain name server
igmp Show Internet Group Management Protocol information
ike Show Internet Key Exchange information
interfaces Show interface information
ipsec Show IP Security information
ipv6 Show IP version 6 information

25

26

JUNOS CLI

isdn
isis
l2circuit
l2vpn
ldp
llc2
log
mld
mpls
msdp
multicast
ntp
ospf
ospf3
pfe
pgm
pim
policer
policy
pppoe
rip
ripng
route
rsvp
sap
services
snmp
system
task
ted
version
vrrp

Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show
Show

Integrated Services Digital Network information


Intermediate System-to-Intermediate System info...
Layer 2 circuit information
Layer 2 VPN information
Label Distribution Protocol information
LLC2 protocol related information
contents of log file
multicast listener discovery information
Multiprotocol Label Switching information
Multicast Source Discovery Protocol information
multicast information
Network Time Protocol information
Open Shortest Path First information
Open Shortest Path First version 3 information
Packet Forwarding Engine information
Pragmatic Generalized Multicast information
Protocol Independent Multicast information
interface policer counters and information
policy information
PPP over Ethernet information
Routing Information Protocol information
Routing Information Protocol for IPv6 information
routing table information
Resource Reservation Protocol information
Session Announcement Protocol information security
services information
Simple Network Management Protocol information
system information
routing protocol per-task information
Traffic Engineering Database information
software process revision levels
Virtual Router Redundancy Protocol information

Cisco IOSJUNOS
IP show IP
IOS show ip route JUNOS show
route

fe-1/1/1 Ethernet show interfaces
show

mike@juniper1> show interfaces fe-1/1/1 ?


Possible completions:
<[Enter]> Execute this command
brief Display brief output

descriptions
detail
extensive
media
snmp-index
statistics
terse
<. . .>

Display interface description strings


Display detailed output
Display extensive output
Display media information
SNMP index of interface
Display statistics and detailed output
Display terse output

brief
terse show
mike@juniper1> show interfaces fe-1/1/1 brief
Physical interface: fe-1/1/1 Enabled, Physic link is Down
Link-level type:Ethernet, MTU: 1514, Spped: 100mbps, Loopback:
Disabled, Source filtering: Disabled
Flow control : Enabled
Device flags : Present Running Down
Interface flags: Hardware-Down SNMP-Traps Internal: Ox4000
Link flags : None
mike@juniper1> show interfaces fe-1/1/1 terse
Interface
Admin Link Proto Local Remote
fe-1/1/1
up up
at-1/3/0.0 up up inet 1.0.0.1 --> 1.0.0.2
iso

clear

JUNOS
UNIX
n ping IP

n traceroute
IP
n ssh UNIX

n telnet

27

28

JUNOS CLI

File

( )

file

n
n
n ( )

file show
mike@juniper1> file show <filename>

le copy
file

copy (

Unix cp )

file copy /target-directory/target-filename /destinationdirectory/destination-filename

(/config/juniper.conf.gz) backup.
gz /var/home/user
mike@juniper1> file copy /config/juniper.conf.gz /var/home/
user/backup.gz

rescue.gz /config

mike@juniper1> file copy /config/juniper.conf.gz /var/home/


user/juniper.conf.gz-20090123

le list
file

list

mike@juniper1> file list


/var/home/user/:
.ssh/
juniper.conf.gz-20090123

4 ( )

( )
JUNOS

(Daemons)

restart
JUNOS (
)
restart

restart
SNMP SNMP

( OSPF)

JUNOS

29

30

JUNOS CLI

request

request

mike@juniper1> request chassis fpc slot 0 restart


Restart initiated, use "show chassis fpc" to verify
user@host> show chassis fpc
Temp CPU Utilization (%) Memory Utilization (%)
Slot State (C) Total Interrupt DRAM (MB) Heap Buffer
0 Starting 32 0 0 0 0 0
1 Online 30 0 0 8 11 14
2 Empty
3 Empty

JUNOS
www.juniper.net/support

JUNOS Software CLI


User Guide JUNOS System Basics and Services Command
Reference www.juniper.net/techpubs/

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
. . . . . . . . . . . . . . . . . . . . . . . .35
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
. . . . . . . . . . . . . . . . . . . . . . . . . . . .47
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48
. . . . . . . . . . . . . . . . . . . . . . . . . . . .49
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

32

JUNOS CLI

JUNOS CLI

JUNOS

JUNOS CLI
Juniper

4.1 JUNOS

1.

CLI

(
)

2.

commit commit
confirmed

( )

3.

/config/juniper.conf.gz
juniper.conf.gz juniper.conf.1.gz
1

4.1

CLI

JUNOS CLI
JUNOS 49 rollback
[0 - 49]

JUNOS

33

34

JUNOS CLI

congure
configure
mike@juniper1> configure
Entering configuration mode

rollback 0

mike@juniper1> configure
Entering configuration mode
The configuration has been changed but not committed
mike@juniper1# exit
The configuration has been changed but not committed
Exit with uncommitted changes? [yes,no]

congure exclusive
exclusive configure

mike@juniper1> configure exclusive


warning: uncommitted changes will be discarded on exit
Entering configuration mode

congure private
private configure

mike@juniper1> configure private


warning:uncommitted changes will be discarded on exit
Entering configuration mode

JUNOS
( )
congure
private
rollback 0

configure exclusive
configure privateJuniper
delete interfaces

JUNOS

show

[edit]
mike@juniper1# show
version9.2R1.3;
groups

35

36

JUNOS CLI

{
re0 {
system {
host-name juniper1;
}
}
}
<... >

(
)
show

[edit interfaces ge-5/0/0]


mike@juniper1# show
gigether-options {
flow-control;
auto-negotiation;
}
unit 0 {
family inet {
address 1.2.3.4/28;
}
}

show
show

set
[edit]
mike@juniper1#
mike@juniper1#
mike@juniper1#
mike@juniper1#

set
set
set
set

system
system
system
system

services
services
services
services

finger
ftp
ssh
telnet

[edit system services]


mike@juniper1# set finger
mike@juniper1# set ftp
mike@juniper1# set ssh
mike@juniper1# set telnet

[edit]
system {
services {
finger;
ftp;
ssh;
telnet;
}
}

CLI edituptop
exit
edit
edit

[edit]
mike@juniper1# edit system services
[edit system services]
mike@juniper1#

edit system syslog


host log
[edit]
mike@juniper1# edit system syslog host log
[edit system syslog host log]
mike@juniper1#

37

38

JUNOS CLI

edit
[edit]
mike@juniper1# edit system
[edit system]
mike@juniper1# edit syslog
[edit system syslog]
mike@juniper1# edit host log
[edit system syslog host log]
mike@juniper1#

edit

UNIX change directory (CD)

edit

CLI
set

up
up

[edit interfaces fe-1/3/1 unit 0 family inet address 10.0.10.1]


mike@juniper1# up

Up
up Unix
[edit interfaces fe-1/3/1 unit 0 family inet]
cd ..
mike@juniper1#

interfacesfe-1/3/1unit 0family inet


address 10.0.10.1

[edit]
interfaces {
fe-1/3/1 {
unit 0 {
family inet {
address 10.0.10.1;
}
}
}
}

Top
top Unix
cd /

top
top

exit
edit

exit

top and edit


[edit protocols ospf area]
mike@juniper1# top edit system login
[edit system login]
mike@juniper1#

top show
[edit protocols ospf area]
mike@juniper1# top show system services
web-management {
http {
port 8080;
}
}

edituptop exit
[edit interfaces]
[edit interfaces fe-0/0/0]
[edit]
[edit protocols bgp]
[edit protocols ldp interface fe-0/0/0.0]
[edit system]
[edit system services telnet]
[edit system syslog archive]
[edit system syslog]
[edit snmp v3]
[edit snmp v3 usm local-engine]
[edit snmp v3 target-parameters sample-parameters parameters]

39

40

JUNOS CLI

( )

set
ftp
set
set

[edit]
mike@juniper1# set system services ftp

system {
services {
ftp;
}
}
Set
set
set
juniper1 set
www.
juniper.net/dayone/
[edit]
JUNOS Software
mike@devicename # set system host-name juniper1
Fundamentals Series Day One
(JUNOS
)
system {
host-name juniper1;
}

delete

delete

delete

[edit]
mike@juniper1# delete protocols

delete
[edit]

CLI

IP 10.201.1.0/24
1. set
[edit]
mike@juniper1# set interfaces se-1/0/0 unit 0 family inet address 10.210.1.0/24

2. show se (
)
[edit]
mike@juniper1# show
interfaces {
se-1/0/0 {
unit 0 {
family inet {
address 10.210.1.0/24;}
}
}
}
}

3. delete
[edit]
mike@juniper1# delete interfaces se-1/0/0

4. show se

41

42

JUNOS CLI

JUNOS
Software CLI User Guide(JUNOS CLI )
www.juniper.net/techpubs/

annotate
JUNOS CLI

annotate
[edit]
mike@juniper1# annotate system this device is for training new
JUNOS users

annotate
[edit]
mike@juniper1# annotate system ""

JUNOS CLI

4.2 ( )

commit (
)
1.

2.
rollback 0

scp ftp

<n>

4 49

/var/db/config

( 1)
v2
v3

03

/config

v4

CLI

<n>

Commit
Event Script
SNMP trap/syslog

v 49

4.2

()

( 0)

JUNOS
( ) /config
/var/db/config

juniper.conf.gz
juniper.conf.1.gz juniper.conf.49.gz ( 50
)

43

44

JUNOS CLI

compare
show

| compare

Telnet SSH J-Web

[edit system]
mike@juniper1# set services telnet
[edit system]
mike@juniper1# delete services web-management
[edit system]
mike@juniper1# delete services ssh

[edit system services]


mike@juniper1# show | compare
- ssh;
+ telnet;
- web-management {
http {
port 8080;
}
- }

(+) (-)

show configuration ( )
run
[edit]
mike@juniper1# run show configuration

commit check
CLI commit
check
commit

[edit]
mike@juniper1# commit check
[edit interfaces lo0 unit 0 family inet]
'address 192.168.69.1/24'
Loopback addresses' prefix must be 32 bits
error: configuration check-out failed

show | compare
commit check

commit
commit

( )
commit
[edit]
mike@juniper1# commit
commit complete

JUNOS

commit
[edit]
mike@juniper1# commit
error: Policy error: Policy my-policy referenced but not defined
error: BGP: export list not applied
error: configuration check-out failed

( )

45

46

JUNOS CLI

commit complete
[edit]
mike@juniper1# commit
commit complete

( congure private
34-35 )

commit conrmed

commit confirmed

commit confirmed 10
commit
commit confirmed
[edit]
mike@juniper1# commit confirmed
commit confirmed will be automatically rolled back in 10 minutes
unless confirmed
commit complete

commit
[edit]
mike@juniper1# commit
commit complete

commit CLI 10

Broadcast Message from root@juniper1


(no tty) at 08:10:17 UTC
Commit was not confirmed; automatic rollback complete.

commit
( )
[edit]
mike@juniper1# commit confirmed 2
commit confirm will be automatically rolled back in 2 minutes
unless confirmed commit complete

commit confirmed
JUNOS

JUNOScript CLI


Op

Conguration and Diagnostic


Automation Guide( ) www.
juniper.net/techpubs/

47

48

JUNOS CLI

JUNOS

49 (
rollback 0)
rollback
rollback 1
[edit]
mike@juniper1# rollback 1
load complete

show commit

rollback

rollback rescue

( [edit]
28 mike@juniper1# show
<. . . >
)
[edit]
mike@juniper1# commit
commit complete

( )
show | compare
[edit interfaces]
mike@juniper1# show | compare rollback 2

[edit interfaces]
- fe-3/0/1 {
vlan-tagging;
unit 240 {
vlan-id 240;
family inet {
address 10.14.250.1/28;
address 10.14.250.17/28 {
preferred;
}
address 10.14.250.33/28;
address 10.14.250.49/28;
address 10.14.250.65/28;
}
}
- }

rollback
[edit]
mike@juniper1# rollback ?
Possible completions:
<[Enter]>
Execute this command
0
2009-01-31 04:34:56 UTC
1
2009-01-31 04:30:03 UTC
2
2009-01-30 06:23:44 UTC
<. . . >
48
2008-11-03 08:00:03 UTC
49
2008-11-03 07:45:21 UTC
|
Pipe through a command

by mike via cli


by mike via cli
by mike via cli
by mike via cli
by mike via cli

rollback (
rollback 0)

JUNOS CLI

JUNOS

49

50

JUNOS CLI

fe-3/0/0
[edit]
mike@juniper1# edit interfaces fe-3/0/0 unit 0
[edit interfaces fe-3/0/0 unit 0]
mike@juniper1# set family inet address 192.168.1.254/24
[edit interfaces fe-3/0/0 unit 0]
mike@juniper1# commit
commit complete

commit at

commit at
[edit]
mike@juniper1# commit at 02:00:00
commit check succeeds
commit will be executed at 2009-02-02 02:00:00 UTC
Exiting configuration mode
mike@juniper1>

( ) show system
commit clear system commit
mike@juniper1>clear system commit
Pending commit cleared

deactivate

192.168.1.1 BGP

[edit]
mike@juniper1# edit protocols bgp group internal
[edit protocols bgp group internal]
mike@juniper1# set neighbor 192.168.1.1
[edit protocols bgp group internal]
mike@juniper1# deactivate neighbor 192.168.1.1
[edit protocols bgp group internal]
mike@juniper1# show
type internal;
local-address 10.14.243.255;
export [ nhs accept-aggregates ];
neighbor 10.14.243.254;
inactive: neighbor 192.168.1.1;
[edit protocols bgp group internal]
mike@juniper1# commit
commit complete

[edit protocols bgp group internal]


mike@juniper1# activate neighbor 192.168.1.1
[edit protocols bgp group internal]
mike@juniper1# commit
commit complete

BGP ( internal)
[edit protocols bgp group internal]
mike@juniper1# up
[edit protocols bgp]
mike@juniper1# deactivate group internal

51

52

JUNOS CLI

JUNOS CLI

copy

copy

se-0/0/2
[edit interfaces]
mike@juniper1# show
se-0/0/2 {
serial-options {
clocking-mode dce;
clock-rate 125.0khz;
}
unit 0 {
point-to-point;
family inet {
address 10.0.22.1/24;
}
}
}

copy se-0/0/1
se-0/0/1

[edit interfaces]
mike@juniper1# copy se-0/0/2 to se-0/0/1
[edit interfaces]
mike@juniper1# delete se-0/0/1 unit 0 family inet address
10.0.22.1/24

[edit interfaces]
mike@juniper1# set se-0/0/1 unit 0 family inet address
10.0.36.2/24

se-0/0/1 se-0/0/2

[edit interfaces]
mike@juniper1# show
se-0/0/1 {
serial-options {
clocking-mode dce;
clock-rate 125.0khz;
}
unit 0 {
point-to-point;
family inet {
address 10.0.36.2/24;
}
}
}
se-0/0/2 {
serial-options {
clocking-mode dce;
clock-rate 125.0khz;
}
unit 0 {
point-to-point;
family inet {
address 10.0.22.1/24;
}
}
}

copy

53

54

JUNOS CLI

rename
( IP )
rename
Ethernet fe-4/0/2
10.73.24.103/24
[edit interfaces]
mike@juniper1# show
fe-4/0/2 {
unit 0 {
family inet {
address 10.73.24.103/24;
}
}
}

rename 10.73.24.143/24
[edit interfaces]
mike@juniper1# rename fe-4/0/2 unit 0 family inet address
10.73.24.103/24 to address 10.73.24.143/24

[edit interfaces]
mike@juniper1# show
fe-4/0/2 {
unit 0 {
family inet {
address 10.73.24.143/24;
}
}
}

delete set
rename

JUNOS
fe-2/0/1 fe-2/0/0

[edit]
mike@juniper1# show interfaces
fe-0/0/0 {
descriptionMGMT INTERFACE - DO NOT DELETE;
unit 0 {
family inet {
address 10.210.9.177/28;
}
}
}
fe-2/0/1 {
vlan-tagging;
unit 240 {
vlan-id 240;
family inet {
address 10.14.243.238/28;
}
}
}

[edit]
mike@juniper1# rename interfaces fe-2/0/1 to fe-2/0/0

[edit]
mike@juniper.net# show interfaces
fe-0/0/0 {
descriptionMGMT INTERFACE - DO NOT DELETE;
unit 0 {
family inet {
address 10.210.9.177/28;
}
}
}
fe-2/0/0 {

55

56

JUNOS CLI

vlan-tagging;
unit 240 {
vlan-id 240;
family inet {
address 10.14.243.238/28;
}
}
}

JUNOS Software
CLI User Guide(JUNOS CLI ) www.
juniper.net/techpubs/

...

www.juniper.net/junos
JUNOS

forums.juniper.net/jnet
Juniper J-Net Juniper

www.juniper.net/techpubs
Juniper
JUNOS

www.juniper.net/books
Juniper

www.juniper.net/training/fasttrack

Juniper Network (JNTCP)


Juniper

e-mail dayone@juniper.net


()

activate

clear

annotate

congure

commit

congure exclusive

commit at
commit check

congure private

commit confirmed

le copy

compare
copy
deactivate
delete
edit
exit

exit conguration-mode
help
pipe

exit

le list
le show
help
monitor
ping
pipe

request
restart
set
show

rename

ssh

rollback

start shell C

run

telnet

set

traceroute
IP hop

show
top
up

JUNOS

#1

JUNOS CLI
JUNOS Juniper Networks
JUNOS

JUNOS CLI

Juniper Networks

Juniper Networks

JUNOS CLI

JUNOS CLI

showset delete
JUNOS

Juniper Networks
www.juniper.net/dayone PDF