Juniper Junos Commands
Juniper Junos CLI commands for routers and switches.
Device Startup Procedure
Step 1: Power on deviceConnect power and boot Junos device
Step 2: Wait for bootWait 3-5 minutes for Junos to fully load
Step 3: Access CLILogin and enter operational mode
show chassis alarmsCheck for hardware alarms
show system boot-messagesDisplay boot messages
Step 4: Verify interfacesCheck interface status
show interfaces terseDisplay brief interface status
Step 5: Check protocolsVerify routing protocols
show route summaryDisplay routing table summary
Basic Navigation
cliEnter CLI from shell
configureEnter configuration mode
edit <hierarchy>Navigate to configuration hierarchy
upMove up one level in hierarchy
topReturn to top level of configuration
exitExit current level or mode
quitExit configuration mode without committing
commitCommit configuration changes
commit checkValidate configuration
commit and-quitCommit and exit configuration mode
rollback <number>Rollback to previous configuration
show configurationDisplay configuration in config mode
show | display setDisplay config in set command format
show | compareDisplay 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> disableDisable interface
delete interfaces <interface> disableEnable interface
set interfaces <interface> speed <speed>Set interface speed
set interfaces <interface> link-mode full-duplexSet 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 trunkConfigure 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 terseDisplay 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 vlansDisplay VLAN information
show vlans extensiveDisplay detailed VLAN information
show ethernet-switching tableDisplay 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 activeEnable LACP on AE interface
set interfaces ae<id> unit 0 family ethernet-switching interface-mode trunkConfigure 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 interfacesDisplay 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 routeDisplay routing table
show route <prefix>Display specific route
show route protocol staticDisplay static routes
show route summaryDisplay 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> passiveSet interface as passive
set protocols ospf export <policy>Export routes into OSPF
set protocols ospf reference-bandwidth <bw>Set reference bandwidth
show ospf neighborDisplay OSPF neighbors
show ospf interfaceDisplay OSPF interfaces
show ospf databaseDisplay OSPF database
show ospf routeDisplay OSPF routes
clear ospf neighborClear 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 summaryDisplay BGP neighbor summary
show bgp neighbor <ip>Display BGP neighbor details
show route protocol bgpDisplay 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 acceptAccept matching packets
set firewall family inet filter <name> term <term> then discardDiscard 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 logLog 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 firewallDisplay firewall configuration
show firewall filter <filter>Display specific filter
show firewall logDisplay 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 statusDisplay cluster status
show chassis cluster interfacesDisplay cluster interfaces
show chassis cluster statisticsDisplay 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-chassisDisplay VC status
show virtual-chassis statusDisplay detailed VC status
show virtual-chassis vc-portDisplay VC ports
request virtual-chassis reactivateReactivate VC configuration
System Management
set system host-name <name>Set hostname
set system root-authentication plain-text-passwordSet root password interactively
set system login user <user> class <class>Create user
set system services sshEnable SSH
set system services netconf sshEnable 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 anyConfigure remote syslog
set snmp community <string> authorization read-onlyConfigure SNMP community
show system uptimeDisplay system uptime
show system usersDisplay logged-in users
show system storageDisplay storage usage
show system licenseDisplay license information
Monitoring & Troubleshooting
show chassis hardwareDisplay hardware components
show chassis environmentDisplay environmental status
show chassis alarmsDisplay system alarms
show versionDisplay Junos version
show system processes extensiveDisplay system processes
show system memoryDisplay memory usage
show interfaces extensiveDisplay detailed interface statistics
monitor interface <interface>Monitor interface in real-time
monitor traffic interface <interface>Capture packets on interface
show log messagesDisplay system log messages
show log messages | match <pattern>Filter log messages
ping <ip> count <count> rapidSend ping with options
traceroute <ip>Trace route to destination
show route forwarding-tableDisplay forwarding table
show pfe statistics trafficDisplay PFE traffic statistics
request support information | save <file>Generate support info file
Software Management
request system software add <package> rebootInstall software and reboot
request system software add <package> no-copy rebootInstall without copying (USB/network)
request system software validate <package>Validate software package
request system snapshot slice alternateBackup to alternate partition
request system snapshot recoveryCreate recovery snapshot
show system snapshot media internalDisplay snapshot information
file list /var/tmpList files in directory
file copy <source> <destination>Copy file
file delete <file>Delete file