IJOS Lab Guide - Lab1.Ready
IJOS Lab Guide - Lab1.Ready
IJOS Lab Guide - Lab1.Ready
Lab 1:
The JU N O S CLI
In this activity, you you will perform the following tasks:
Page 1
IP Address
10.0.P.10 /24
10.0.P.11 /24
172.16.P.10 /24
172.26.26.P /24
Default Gateway
10.0.P.1
10.0.P.1
172.16.P.1
172.26.26.150
Step 1.2
To access the IJOS Lab from the web:
1. Access to the TP Lab Portal / SSL VPN.
2. login using the username / password provided by your instructor.
3. Select the assigned pod number to access your device.
Step 1.3
To access the CLI of SRX device, log in to SRX with root account and access the
command line interface by using CLI command.
Amnesiac (ttyu0)
login: root
Password: ( without password or juniper123)
--- JUNOS 12.1R1.9 built 2012-03-24 12:12:49 UTC
root@% cli
root>
Step 1.4
Enter the configuration mode of SRX device.
root> configure
Page 2
Step 1.5
Setup a password for root account, use password: juniper123
Note: without password for root account, you will not be able to commit any
configuration.
[edit]
root# set system root-authentication plain-text-password
New password: juniper123
(Do not use other password!)
Retype new password: juniper123
(Do not use other password!)
Step 1.6
Create a new admin account. Use username: admin and password: juniper123. This
user should belong to default super-user login class.
Do not use other password!
[edit]
root# set system login user admin class super-user authentication plain-text-password
New password: juniper123
(Do not use other password!)
Retype new password: juniper123
(Do not use other password!)
Step 1.7
Disable the firewall function of your SRX. This command will leave your SRX as a routing
device only.
[edit]
root# set security forwarding-options family mpls mode packet-based
[edit]
root# commit and-quit
warning: You have changed mpls flow mode.
You have to reboot the system for your change to take effect.
If you have deployed a cluster, be sure to reboot all nodes.
commit complete
Page 3
Step 1.8
Reboot your SRX device for the mpls packet mode to take effect.
root> request system reboot
Reboot the system ? [yes,no] (no) yes
Shutdown NOW!
[pid 1669]
root>
*** FINAL System shutdown message from root@ ***
System going down IMMEDIATELY
Step 2.2
Determine what system information you can clear from the operational mode command
prompt.
admin> clear ?
Page 4
Possible completions:
amt
arp
auto-configuration
bfd
bgp
bridge
chassis
database-replication
dhcpv6
dot1x
esis
ethernet-switching
firewall
gvrp
helper
igmp
igmp-snooping
interfaces
ipv6
isdn
isis
l2-learning
lacp
ldp
lldp
log
mld
mpls
msdp
multicast
network-access
ospf
ospf3
passive-monitoring
pfe
pgm
pim
ppp
pppoe
r2cp
rip
ripng
rsvp
security
services
snmp
spanning-tree
system
vpls
vrrp
wlan
Clear
Clear
Clear
Clear
Clear
Clear
Clear
services
Simple Network Management Protocol information
Spanning Tree Protocol information
system information
learned Layer 2 MAC address information
Virtual Router Redundancy Protocol statistics
Wireless LAN information
Question:
Which command do you use to clear the contents of a system log (syslog) file?
____________________________________________________________________________
Answer:
Use the clear log log-filename command to clear the contents of a particular
syslog file.
Step 2.3
Experiment with command completion by entering show i<space>.
admin> show i
^
'i' is ambiguous.
Possible completions:
iccp
igmp
igmp-snooping
ingress-replication
interfaces
ipv6
isdn
isis
Show
Show
Show
Show
Show
Show
Show
Show
Step 2.4
Add characters to disambiguate your command so that you can display interfacerelated information; use the Spacebar or Tab key for automatic command completion.
Note: You can return to the command prompt without scrolling through all of the
generated output from a command. Enter the Ctrl+c key sequence to abort the operation
and return to the command prompt.
admin> show int<space>erfaces
Physical interface: ge-0/0/0, Enabled, Physical link is Down
Interface index: 134, SNMP ifIndex: 507
Link-level type: Ethernet, MTU: 1514, Link-mode: Full-duplex, Speed: 1000mbps,
Page 6
Step 2.5
Try to clear SNMP statistics by entering the clear snmp command.
admin> clear snmp
^
syntax error, expecting <command>.
Question:
Answer:
The display indicates that the command was incomplete as entered. The
caret symbol (^) indicates the area of the problem, and the error message
tells you that the system expects additional command input.
Step 2.6
Page 7
Verify that the CLI does not let you complete invalid commands by trying to enter the
command show ip interface brief.
admin> show ip<space>
admin> show ipv6
admin> show ipinterfacebrief
^
syntax error, expecting <command>.
Question:
Answer:
Step 2.7
Enter a show system users followed by a show system license command. You are
entering these commands to demonstrate command history recall. When finished, enter
the keyboard sequences indicated to answer the related questions.
admin> show system users
9:54AM up 7 mins, 1 user, load averages: 0.13, 1.21, 0.84
USER
TTY
FROM
LOGIN@ IDLE WHAT
admin
u0
9:49AM
- -cli (cli)
admin> show system license
License usage:
Feature name
av_key_kaspersky_engine
anti_spam_key_sbl
wf_key_surfcontrol_cpa
idp-sig
dynamic-vpn
ax411-wlan-ap
logical-system
Licenses
used
0
0
0
0
0
0
0
Licenses
installed
1
1
1
1
50
2
1
Licenses installed:
Page 8
Licenses
needed
0
0
0
0
0
0
0
Expiry
2015-04-10
2015-04-10
2015-04-10
2015-04-10
permanent
permanent
permanent
00:00:00
00:00:00
00:00:00
00:00:00
UTC
UTC
UTC
UTC
Question:
Answer:
The system recalls the show system users command and displays it at the
prompt.
Question:
Answer:
The system recalls the next command in the buffer, which is a show system
license command in this example.
Question:
What happens when you use the Up Arrow and Down Arrow keys?
____________________________________________________________________________
Answer:
The Up Arrow and Down Arrow keys function as substitutes for the Ctrl+p and
Ctrl+n sequences as long as the system is configured for VT100-type emulation,
which is the default.
Step 2.8
In many cases, the output of a command might exceed one full screen. For example, the
show interfaces interface-name extensive command displays a lot of information
about the specified interface. Enter this command now for your systems ge-0/0/0
interface, and answer the following questions. Use the h key as needed to obtain help
when CLI output is paused at the ---(more)--- prompt.
admin> show interfaces ge-0/0/0 extensive
Physical interface: ge-0/0/0, Enabled, Physical link is Down
Interface index: 134, SNMP ifIndex: 507, Generation: 137
Link-level type: Ethernet, MTU: 1514, Link-mode: Full-duplex, Speed: 1000mbps,
BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled,
Page 9
Question:
Answer:
The Spacebar causes the display to scroll forward to display the next screen of
output.
Question:
What effect does pressing the Enter key have on the paused output?
____________________________________________________________________________
Answer:
The Enter key causes the display to scroll forward by one line.
Question:
Answer:
Pressing the b key causes the display to scroll backwards by one full screen, up
to the point where the first full screen of information displays.
Question:
Page 10
Answer:
Pressing the u key causes the display to scroll backwards by one half of a
screen, up to the point where the first screen displays.
Question:
Which key would you press to search forward through a display that consists
of multiple screens of output?
____________________________________________________________________________
Answer:
To search forward, press the forward slash (/) character followed by the
search pattern.
Step 2.9
Use the pipe ( | ) and match functions of the Junos CLI to list all interfaces that are
physically down.
admin> show interfaces | match down
Physical interface: ge-0/0/0, Enabled, Physical link is Down
Device flags : Present Running Down
Interface flags: Hardware-Down SNMP-Traps Internal: 0x0
Physical interface: ge-0/0/4, Enabled, Physical link is Down
Device flags : Present Running Down
Interface flags: Hardware-Down SNMP-Traps Internal: 0x0
Physical interface: ge-0/0/6, Enabled, Physical link is Down
Device flags : Present Running Down
Interface flags: Hardware-Down SNMP-Traps Internal: 0x0
Question:
Answer:
In this example, the answer is yes; several interfaces show as Down. The
interfaces shown might vary depending on your lab environment.
Question:
Can you think of a way to have the Junos OS count the number of interfaces
that are physically down? (Hint: Remember that you can use the results of one
pipe as input to another pipe operation.)
____________________________________________________________________________
Answer:
To count the number of down interfaces, pipe the results of the previous
command to the CLI count function. In this example, we included an extra
match function to ensure that the software does not count interfaces that are
down both logically and physically more than once:
Page 11
Step 2.10
A large portion of the Junos OS documentation is available directly from the CLI. You
can retrieve high-level topics using the help topic command, whereas you can obtain
detailed configuration-related information with the help reference command.
Use the help reference command along with the CLI question-mark operator (?) to find
detailed information about configuring a system hostname.
Question:
Answer:
Step 2.11
Enter configuration mode.
Page 12
admin> configure
Entering configuration mode
[edit]
admin#
Question:
Answer:
A pound sign (#) replaces the angle bracket (>), and a configuration hierarchy
banner displays.
Question:
Answer:
The display indicates that you are now at the [edit] hierarchy, which is the root
of the configuration tree:
Step 2.12
Display the interfaces portion of the candidate configuration.
[edit]
admin# show interfaces
[edit]
admin#
Note: You will not see any configuration under the interfaces hierarchy, since you have
deleted all configuration in previous step.
Step 2.13
Position yourself at the [edit interfaces] configuration hierarchy.
[edit]
admin# edit interfaces
[edit interfaces]
admin#
Page 13
Question:
Answer:
The banner now correctly shows that the user is at the [edit interfaces]
portion of the configuration hierarchy.
Question:
Answer:
Step 2.14
Move to the [edit protocols ospf] portion of the hierarchy. This step requires that you
first visit the root of the hierarchy, as you cannot jump directly between branches. You
can perform this step with a single command in the form of top edit protocols ospf,
however.
[edit interfaces]
admin# top edit protocols ospf
[edit protocols ospf]
admin#
Question:
Which commands can you now enter to reposition yourself at the [edit]
portion of the hierarchy? Return to the [edit] hierarchy level now.
____________________________________________________________________________
Answer:
You can issue an up command twice, or an up 2 command. You can also issue
an exit command or a top command.
Step 2.15
Try to display the status of chassis hardware with a show chassis hardware operational
command while in configuration mode.
[edit interfaces]
admin# top edit protocols ospf
[edit protocols ospf]
admin# show chassis
^
syntax error.
Question:
Why do you think you received an error? What can you do to execute
operational mode commands while in configuration mode? Try that now.
____________________________________________________________________________
Answer:
Description
SRX240H
RE-SRX240H
FPC
16x GE Base PIC
Step 2.16
Try to return to operational mode by entering an exit command.
[edit protocols ospf]
admin# top
[edit]
admin# exit
The configuration has been changed but not committed
Exit with uncommitted changes? [yes,no] (yes) no
Page 15
Question:
Answer:
You should see a message indicating that uncommitted changes exist. This
message results from the creation of an empty [edit protocols ospf] stanza.
This empty stanza causes the configuration database to believe that the
configuration actually changed.
Question:
Which CLI command can you use to display differences between the candidate
and active configuration file? Enter no at the current prompt and issue the
required command to view the differences between the candidate and active
configurations.
____________________________________________________________________________
Answer:
Use the show command with the results piped to compare rollback number. In
this example, you should not see any actual configuration changes, as shown in
the following sample capture:
[edit]
admin# show | compare rollback 0
[edit]
admin#
Question:
Considering that nothing changed, which command can you enter to allow an
exit from configuration mode without being warned of uncommitted changes?
Issue that command now?
____________________________________________________________________________
Answer:
[edit]
admin# rollback 0
load complete
[edit]
admin# exit
Exiting configuration mode
Page 16
admin>
Step 2.17
Save the current configuration to admins home directory.
admin> file list
/cf/var/home/admin/:
.ssh/
admin> configure
Entering configuration mode
[edit]
admin# save IJOS.LAB1
Wrote 25 lines of configuration to 'IJOS.LAB1'
[edit]
[edit]
admin# run file list
/cf/var/home/admin/:
.ssh/
IJOS.LAB1