Juniper Junos Commands

Juniper Junos CLI commands for routers and switches.

Device Startup Procedure

Step 1: Power on device

Connect power and boot Junos device

Step 2: Wait for boot

Wait 3-5 minutes for Junos to fully load

Step 3: Access CLI

Login and enter operational mode

show chassis alarms

Check for hardware alarms

show system boot-messages

Display boot messages

Step 4: Verify interfaces

Check interface status

show interfaces terse

Display brief interface status

Step 5: Check protocols

Verify routing protocols

show route summary

Display routing table summary

Basic Navigation

cli

Enter CLI from shell

configure

Enter configuration mode

edit <hierarchy>

Navigate to configuration hierarchy

up

Move up one level in hierarchy

top

Return to top level of configuration

exit

Exit current level or mode

quit

Exit configuration mode without committing

commit

Commit configuration changes

commit check

Validate configuration

commit and-quit

Commit and exit configuration mode

rollback <number>

Rollback to previous configuration

show configuration

Display configuration in config mode

show | display set

Display config in set command format

show | compare

Display uncommitted changes

Interface Configuration

set interfaces <interface> description "<text>"

Set interface description

set interfaces <interface> unit 0 family inet address <ip>/<mask>

Configure IP address

set interfaces <interface> disable

Disable interface

delete interfaces <interface> disable

Enable interface

set interfaces <interface> speed <speed>

Set interface speed

set interfaces <interface> link-mode full-duplex

Set full duplex

set interfaces <interface> mtu <bytes>

Set MTU

set interfaces <interface> unit 0 family ethernet-switching vlan members <vlan>

Assign VLAN to access port

set interfaces <interface> unit 0 family ethernet-switching interface-mode trunk

Configure trunk port

set interfaces <interface> unit 0 family ethernet-switching vlan members [ <vlans> ]

Set allowed VLANs on trunk

set interfaces <interface> ether-options 802.3ad <ae-id>

Add interface to aggregated ethernet

show interfaces terse

Display brief interface status

show interfaces <interface>

Display detailed interface info

VLAN Configuration

set vlans <name> vlan-id <id>

Create VLAN

set vlans <name> description "<text>"

Set VLAN description

set vlans <name> l3-interface vlan.<id>

Associate VLAN with L3 interface

set interfaces vlan unit <id> family inet address <ip>/<mask>

Configure VLAN interface (SVI)

show vlans

Display VLAN information

show vlans extensive

Display detailed VLAN information

show ethernet-switching table

Display MAC address table

Aggregated Ethernet (LAG)

set chassis aggregated-devices ethernet device-count <count>

Set number of AE interfaces

set interfaces ae<id> aggregated-ether-options lacp active

Enable LACP on AE interface

set interfaces ae<id> unit 0 family ethernet-switching interface-mode trunk

Configure AE as trunk

set interfaces <interface> ether-options 802.3ad ae<id>

Add member to LAG

show interfaces ae<id>

Display AE interface status

show lacp interfaces

Display LACP information

show lacp statistics interfaces ae<id>

Display LACP statistics

Routing - Static

set routing-options static route <network> next-hop <ip>

Add static route

set routing-options static route 0.0.0.0/0 next-hop <ip>

Add default route

set routing-options static route <network> qualified-next-hop <ip> preference <value>

Add backup route with different preference

show route

Display routing table

show route <prefix>

Display specific route

show route protocol static

Display static routes

show route summary

Display route summary

Routing - OSPF

set protocols ospf area <area> interface <interface>

Enable OSPF on interface

set routing-options router-id <id>

Set router ID

set protocols ospf area <area> interface <interface> passive

Set interface as passive

set protocols ospf export <policy>

Export routes into OSPF

set protocols ospf reference-bandwidth <bw>

Set reference bandwidth

show ospf neighbor

Display OSPF neighbors

show ospf interface

Display OSPF interfaces

show ospf database

Display OSPF database

show ospf route

Display OSPF routes

clear ospf neighbor

Clear OSPF neighbor sessions

Routing - BGP

set routing-options autonomous-system <as>

Set local AS number

set protocols bgp group <name> type <type>

Create BGP group (internal/external)

set protocols bgp group <name> neighbor <ip> peer-as <as>

Add BGP neighbor

set protocols bgp group <name> neighbor <ip> description "<text>"

Set neighbor description

set protocols bgp group <name> export <policy>

Apply export policy to group

set protocols bgp group <name> import <policy>

Apply import policy to group

set protocols bgp group <name> local-address <ip>

Set source IP for BGP

show bgp summary

Display BGP neighbor summary

show bgp neighbor <ip>

Display BGP neighbor details

show route protocol bgp

Display BGP routes

clear bgp neighbor <ip>

Clear BGP session

Firewall Filters (ACLs)

set firewall family inet filter <name> term <term> from <match-condition>

Set match condition

set firewall family inet filter <name> term <term> then accept

Accept matching packets

set firewall family inet filter <name> term <term> then discard

Discard matching packets

set firewall family inet filter <name> term <term> then count <counter>

Count matching packets

set firewall family inet filter <name> term <term> then log

Log matching packets

set interfaces <interface> unit 0 family inet filter input <filter>

Apply filter to interface input

set interfaces <interface> unit 0 family inet filter output <filter>

Apply filter to interface output

show firewall

Display firewall configuration

show firewall filter <filter>

Display specific filter

show firewall log

Display firewall logs

High Availability (Chassis Cluster)

set chassis cluster cluster-id <id> node <0|1>

Set cluster ID and node number

set chassis cluster reth-count <count>

Set number of redundant ethernet interfaces

set chassis cluster redundancy-group <id> node <node> priority <priority>

Set RG priority

set interfaces <interface> redundant-ether-options redundancy-group <id>

Associate interface with RG

show chassis cluster status

Display cluster status

show chassis cluster interfaces

Display cluster interfaces

show chassis cluster statistics

Display cluster statistics

request chassis cluster failover redundancy-group <id> node <node>

Trigger manual failover

Virtual Chassis

request virtual-chassis mode <mode>

Set VC mode (fabric or mixed)

set virtual-chassis member <member> serial-number <serial>

Add member to VC

set virtual-chassis member <member> role <role>

Set member role (master, backup, line-card)

set virtual-chassis vcp-mtu <bytes>

Set VCP MTU

show virtual-chassis

Display VC status

show virtual-chassis status

Display detailed VC status

show virtual-chassis vc-port

Display VC ports

request virtual-chassis reactivate

Reactivate VC configuration

System Management

set system host-name <name>

Set hostname

set system root-authentication plain-text-password

Set root password interactively

set system login user <user> class <class>

Create user

set system services ssh

Enable SSH

set system services netconf ssh

Enable NETCONF over SSH

set system name-server <ip>

Configure DNS server

set system ntp server <ip>

Configure NTP server

set system time-zone <zone>

Set timezone

set system syslog host <ip> any any

Configure remote syslog

set snmp community <string> authorization read-only

Configure SNMP community

show system uptime

Display system uptime

show system users

Display logged-in users

show system storage

Display storage usage

show system license

Display license information

Monitoring & Troubleshooting

show chassis hardware

Display hardware components

show chassis environment

Display environmental status

show chassis alarms

Display system alarms

show version

Display Junos version

show system processes extensive

Display system processes

show system memory

Display memory usage

show interfaces extensive

Display detailed interface statistics

monitor interface <interface>

Monitor interface in real-time

monitor traffic interface <interface>

Capture packets on interface

show log messages

Display system log messages

show log messages | match <pattern>

Filter log messages

ping <ip> count <count> rapid

Send ping with options

traceroute <ip>

Trace route to destination

show route forwarding-table

Display forwarding table

show pfe statistics traffic

Display PFE traffic statistics

request support information | save <file>

Generate support info file

Software Management

request system software add <package> reboot

Install software and reboot

request system software add <package> no-copy reboot

Install without copying (USB/network)

request system software validate <package>

Validate software package

request system snapshot slice alternate

Backup to alternate partition

request system snapshot recovery

Create recovery snapshot

show system snapshot media internal

Display snapshot information

file list /var/tmp

List files in directory

file copy <source> <destination>

Copy file

file delete <file>

Delete file