Basic Operations #
Navigation and User Interface #
Start the Junos OS CLI #
-
Log in as
root -
Start the CLI
root# cli root@>The > command prompt shows that you are in operational mode. Later, when you enter configuration mode, the prompt will change to #.
-
Type ? to show the top-level commands available in operational mode
root@> ?Possible completions: clear Clear information in the system configure Manipulate software configuration information diagnose Invoke diagnose script file Perform file operations [...] -
Methods to exit the paginated output
---(more ...%)--- q % or ---(more ...%)--- <Ctrl+C>
Navigate Between OS Modes #
-
When you log in to the device and type the
clicommand and press Enter, you are automatically in operational mode---JUNOS 17.2B1.8 built 2018-05-09 23:41:29 UTC % cli user@hostname> -
To enter configuration mode, type the
configurecommand or theeditcommand in CLI operational modeuser@hostname> configure Entering configuration mode [edit] user@hostname# -
You can exit configuration mode and return to operational mode in one of the following ways
[edit] user@hostname# commit and-quit % or [edit] user@hostname# exit -
Use the
runcommand to run operational mode commands whlie in configuration mode[edit] user@hostname# run <operational_mode_command>
Device Configuration #
Configure Hostname #
[edit]
root# set system host-name <hostname>
Configure Root Password #
[edit]
root# set system root-authentication plain-text-password
New password: **********
Retype new password: **********
Configure User Account #
-
Create the local user account
[edit] root# set system login user <user> class super-user -
Set the encrypted password
[edit] root# set system login user <user> authentication plain-text-password New password: ********** Retype new password: **********
Configure a Range of Interfaces #
user@hostname# wildcard range set interfaces ge-0/0/[<start>-<end>]
Delete Specific Configuration #
[edit]
user@hostname# delete <configuration_command>
SSH Configuration #
-
Configure hostname and domain name
user@hostname# set system host-name <hostname> user@hostname# set system domain-name <domain_name> -
Configure AES key pair
set system services ssh ciphers aes256-ctr set system services ssh ciphers aes256-cbc set system services ssh ciphers aes192-ctr set system services ssh ciphers aes192-cbc set system services ssh ciphers aes128-ctr set system services ssh ciphers aes128-cbc -
Allow users to login by SSH
user@hostname# set system services ssh protocol-version v2 -
Choose SSH version
user@hostname# set system services ssh
Verify and Monitor Juniper Device #
user@hostname> show configuration
user@hostname> show system commit
user@hostname> show interfaces
user@hostname> show arp
user@hostname> show version
Network Discovery #
Link Layer Discovery Protocol #
-
Enable LLDP globally
[edit] user@hostname# set protocols lldp interface all -
Enable LLDP for an interface
[edit] user@hostname# set protocols lldp interface <interface> -
Show all LLDP neighbors
user@hostname> show lldp neighbors
Device Management and Security #
Shut Down Unused Ports #
-
Identify unused ports
user@hostname> show interfaces terse -
Shut down unused ports
[edit] user@hostname# set interfaces <interface> disable
Upgrade the Switch #
-
Download the latest Junos OS image from Support - Juniper Networks
-
List the disks connected to your system
diskutil list/dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.3 GB disk0 1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1 2: Apple_APFS Container disk3 494.4 GB disk0s2 3: Apple_APFS_Recovery Container disk2 5.4 GB disk0s3 /dev/disk3 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +494.4 GB disk3 Physical Store disk0s2 1: APFS Volume Macintosh HD 10.7 GB disk3s1 2: APFS Snapshot com.apple.os.update-... 10.7 GB disk3s1s1 3: APFS Volume Preboot 6.6 GB disk3s2 4: APFS Volume Recovery 966.2 MB disk3s3 5: APFS Volume Data 141.3 GB disk3s5 6: APFS Volume VM 1.1 GB disk3s6 /dev/disk4 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *8.1 GB disk4 1: Windows_NTFS Untitled 8.1 GB disk4s1 -
Unmount the USB drive
diskutil unmountDisk /dev/disk4 -
Write the Junos image to the USB drive
sudo dd if=junos-install-media-usb-ex-arm-32-21.4R3-S9.5.img of=/dev/rdisk4 bs=1mMake sure to replace
junos-install-media-usb-ex-arm-32-21.4R3-S9.5.imgwith the correct file path for your Junos image. Use/dev/rdisk4instead of/dev/disk4for faster write speeds on macOS. -
Display the current configuration
cscc@twchou_J2300> show configuration | display set -
Boot and install from USB
Boot Menu 1. Boot [P]revious installed Junos packages 2. Boot Junos in [S]ingle user mode 3. Boot from [R]ecovery snapshot 4. Boot from [U]SB 5. Boot to [O]AM shell 6. Snapshot [B]oot menu 7. [M]ain menu -
Verify the installed version
--- JUNOS 21.4R3-S9.5 Kernel 32-bit JNPR-12.1-20240304.935bb4f_buil root@:RE:0% cli {master:0} root> show version -
Configure additional settings
{master:0} root> configure Entering configuration mode {master:0}[edit] root# delete chassis auto-image-upgrade {master:0}[edit] root# set system root-authentication plain-text-password New password: Retype new password: {master:0}[edit] root# commit
Reset the Switch #
Revert a Juniper EX2300 switch to its factory-default configuration using the Factory Reset/Mode button.
- Press the Factory Reset/Mode button for 10 seconds
The switch transitions into factory-default configuration, the console displays committing factory default configuration, and the Link/Activity LED on the RJ-45 network ports and the uplink ports is lit steadily in green color.
- Press the Factory Reset/Mode button for 10 more seconds
The switch transitions into initial setup mode, the console displays committing ezsetup config, and the Link/Activity LED on the RJ-45 network ports and the uplink ports blink in green color.