High Availability · Topic 2 of 5
GRES, NSR and NSB
Learn Junos Routing Engine redundancy for the JN0-364: GRES, nonstop active routing, nonstop bridging, commit synchronize and switchover checks.
- 5 min
- GRES:
set chassis redundancy graceful-switchover; keeps the PFEs forwarding through a switchover. - GRES alone resets routing sessions; add NSR or rely on GR helpers.
- NSR:
set routing-options nonstop-routing; needs GRES andcommit synchronize.
What it is
An MX router with two Routing Engines (REs) has a primary (master) RE and a backup. If the primary fails, the backup takes over. Three features decide how much survives that switchover.
Graceful Routing Engine switchover (GRES) keeps the forwarding plane running, so packets keep flowing. Nonstop active routing (NSR) adds the routing protocols, so neighbors never notice the switchover. Nonstop bridging (NSB) does the same for Layer 2 control protocols such as spanning tree.
How it works
Without GRES
When the primary RE fails and GRES is off, the new primary RE restarts the Packet Forwarding Engines (PFEs) and relearns all state. Interfaces flap, forwarding stops and every neighbor sees the router go away and come back.
GRES
With GRES, the primary RE continuously copies interface and kernel state, including the forwarding table, to the backup RE. At switchover the PFEs are not restarted, so traffic keeps flowing on the existing forwarding entries.
GRES alone does not keep routing protocols running. The routing process starts fresh on the new primary RE, so OSPF, IS-IS, BGP and other sessions reset unless something else covers them: either graceful restart helpers on the neighbors, or NSR on this router.
user@R1# set chassis redundancy graceful-switchover
user@R1# set system commit synchronize
commit synchronize makes every commit apply to both REs, so the backup always has the same configuration. GRES needs it.
NSR
NSR runs the routing protocol process on the backup RE as well and keeps it in sync: routes, adjacencies and session state are copied from the primary. At switchover the backup is already up to date, so neighbors see no change and no help is needed from them.
user@R1# set chassis redundancy graceful-switchover
user@R1# set system commit synchronize
user@R1# set routing-options nonstop-routing
| Requirement | Why |
|---|---|
| GRES | NSR depends on the forwarding plane surviving the switchover |
commit synchronize | Both REs must have the same configuration |
| No graceful restart | GR and NSR cannot be enabled together; the commit fails |
NSB
NSB keeps the Layer 2 control protocol process synchronized between the REs, so spanning tree state survives a switchover and ports do not reconverge.
user@R1# set chassis redundancy graceful-switchover
user@R1# set system commit synchronize
user@R1# set protocols layer2-control nonstop-bridging
NSB has the same requirements as NSR: GRES and commit synchronize.
Comparing the features
| Feature | What survives a switchover | Needs | Neighbors involved? |
|---|---|---|---|
| GRES | Forwarding plane and interface state | Two REs, commit synchronize | No, but their routing sessions reset without GR or NSR |
| GRES plus GR | Forwarding plus routes, with neighbor help | Neighbors as GR helpers | Yes, they must support GR |
| NSR | Forwarding plus routing protocol sessions | GRES, commit synchronize, no GR | No |
| NSB | Forwarding plus Layer 2 control protocol state | GRES, commit synchronize | No |
Monitoring
| Command | Run on | Shows |
|---|---|---|
show system switchover | Backup RE | Whether GRES is on and the backup is ready |
show task replication | Primary RE | Whether NSR replication is enabled and which protocols are synchronized |
show chassis routing-engine | Either | Each RE's role (master or backup) and health |
request chassis routing-engine master switch | Primary RE | Starts a manual switchover |
On the backup RE, a ready GRES shows lines such as:
{backup}
user@R1> show system switchover
Graceful switchover: On
Configuration database: Ready
Kernel database: Ready
Peer state: Steady State
show task replication on the primary lists each protocol with its synchronization status. Only switch over when the status is complete for the protocols you care about.
{master}
user@R1> show task replication
Stateful Replication: Enabled
RE mode: Master
Troubleshooting checklist
| Symptom | Likely cause |
|---|---|
| Commit of NSR or NSB fails | GRES or commit synchronize missing, or graceful restart configured with NSR |
show system switchover not Ready | The backup RE is still synchronizing, or GRES was just enabled |
| Traffic lost at switchover | GRES not enabled, so the PFEs restarted |
| Routing sessions reset at switchover with GRES on | Neither NSR on this router nor GR helpers on the neighbors |
Run show system switchover on the backup RE. On the primary it does not report the readiness you need.
Common mistakes
Thinking GRES keeps routing protocols up. GRES protects forwarding only. Routing sessions need NSR, or GR with helper neighbors.
Configuring NSR without GRES. NSR and NSB both require GRES and commit synchronize.
Enabling GR and NSR together. They cannot be enabled together. Choose NSR when you do not want to depend on neighbors.
Switching over before the backup is ready. Check show system switchover and show task replication first.
NSB protects Layer 2 control protocol state such as spanning tree. It does not protect routing protocols, and NSR does not protect spanning tree.
What to remember for the exam
- GRES:
set chassis redundancy graceful-switchover; keeps the PFEs forwarding through a switchover. - GRES alone resets routing sessions; add NSR or rely on GR helpers.
- NSR:
set routing-options nonstop-routing; needs GRES andcommit synchronize. - NSB:
set protocols layer2-control nonstop-bridging; needs GRES andcommit synchronize. - GR and NSR cannot be enabled together.
- Verify GRES with
show system switchoveron the backup RE, NSR withshow task replicationon the primary. - Manual switchover:
request chassis routing-engine master switch.
Check yourself
GRES is enabled, but OSPF and BGP neighbors drop at every switchover. Which feature keeps them up without help from the neighbors?
NSR, enabled with
set routing-options nonstop-routing.What two things must be configured before NSR will commit?
GRES (
chassis redundancy graceful-switchover) andsystem commit synchronize.On which Routing Engine do you run
show system switchoverto check GRES readiness?On the backup Routing Engine.
Topic 2 of 5 in High Availability
Test yourself on High Availability
The full Juniper JNCIS-SP JN0-364 question bank has 860 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.