If you are coming from Cisco IOS, the Junos CLI feels inverted at first — but once you understand its two modes and the commit model, it is the most predictable network OS you will ever run. This guide is the single fastest path to confidence with the Junos CLI for a working engineer who has never typed configure before.

The Two Modes and Why They Matter

Every Junos session starts in operational mode, indicated by the > prompt. This is where you run show commands, trace packets, restart daemons and read statistics. Typing configure moves you into configuration mode, indicated by the # prompt. Every change you want to make starts and ends in configuration mode.

root> configure
Entering configuration mode
root# edit protocols ospf
[edit protocols ospf]
root# set area 0.0.0.0 interface ge-0/0/0.0
root# commit and-quit
commit complete
Exiting configuration mode

The Commit Model — Your Safety Net

Unlike IOS, configuration changes are staged in a candidate configuration. Nothing touches the running router until you commit. The single most valuable habit to internalize is commit confirmed:

root# commit confirmed 5
commit complete
-- automatically rolled back in 5 minutes unless confirmed --
If you lose remote connectivity after a bad change, the router rolls itself back within the timer. You never lock yourself out of a Juniper box again. The first thing we teach every new engineer on the team is “always commit confirmed”.

Rollback and Rescue

Junos keeps the last fifty committed configurations. To recover, you simply do:

root# rollback 1
root# commit

This is the equivalent of Cisco’s reload in 5 automatic rollback, except it stays available for as long as you want. Combined with commit confirmed, you have a rapid rescue path that survives every situation except a hardware failure.

Commands Worth Memorizing

There are a thousand published set commands. There are five you use every day:

  • show configuration | display set — view the running config as the exact set commands you would type. Invaluable for documentation.
  • show interfaces diagnostics optics ge-0/0/0 — DOM/optical levels for any SFP/QSFP.
  • request system software add /var/tmp/junos-xxx.tgz reboot — safe Junos upgrade with explicit reboot.
  • monitor interface ge-0/0/0 — real-time traffic statistics.
  • show log messages | last 50 — last 50 syslog lines, the equivalent of sh log | in on IOS.

Bonus: Rescuing a Misconfigured Routing Engine

If you commit a change that breaks the RE itself, the system may stay pingable but break BGP or OSPF. To recover:

root> configure
Entering configuration mode
root# rollback rescue
root# commit
commit complete

What To Learn Next

Practice these on a free vSRX or an EX switch from the lab. Master commit confirmed and rollback before anything else — they will save your career at 2 AM. After that, head to our OSPF on MX guide for the first real routing tutorial, or our JNCIA study plan if you are working towards certification. For long-form EVPN fabric, see EVPN three-vendor interop. For SRX security, see SRX zone firewall.