Juniper EX Virtual Chassis Configuration: Step-by-Step CLI Guide - 夜莺博客

Juniper EX Virtual Chassis Configuration: Step-by-Step CLI Guide

A Virtual Chassis turns up to ten Juniper EX switches into one logical device that shares a control plane, runs one configuration and gives you active/standby RE redundancy cheaply. This guide walks through the CLI that makes it happen: preprovisioning members so the configuration exists before the hardware does, designating and cabling Virtual Chassis ports, setting mastership priority and member IDs, handling mixed and non-provisioned modes, and verifying the fabric is actually formed. The examples use EX4300/EX4650 conventions but the concepts carry across the EX range.

Two ways to build one

Mode How members are identified When to use it
Preprovisioned By serial number and assigned role Production - roles and IDs are deterministic, a replaced switch gets the expected role back
Non-provisioned Automatically, as members are cabled Labs and quick builds - mastership and IDs are decided by election

Step 1: Preprovision the members

user@ex-0> configure
[edit virtual-chassis]
user@ex-0# set preprovisioned
user@ex-0# set member 0 serial-number ABC123 role routing-engine
user@ex-0# set member 1 serial-number DEF456 role routing-engine
user@ex-0# set member 2 serial-number GHI789 role line-card
user@ex-0# set member 2 no-split-detection
user@ex-0# set member 3 serial-number JKL012 role line-card
user@ex-0# set member 3 no-split-detection
user@ex-0# set mastership-priority 200
user@ex-0# commit and-quit

Roles matter. A routing-engine member can become master; a line-card member cannot, which is how you prevent a closet switch from taking over the chassis during a split. Setting no-split-detection on line-card members avoids the split-detection shutdown that triggers when a large chassis loses half its VCP links - intended for two-member edge topologies, dangerous if used blindly.

Step 2: Create and cable the VCPs

! Dedicated VCP ports on EX4300 (the rear 40G ports)
user@ex-0# set virtual-chassis vcp-ports vcp-0
user@ex-0# set virtual-chassis vcp-ports vcp-1

! Uplink ports converted to VCPs where needed
user@ex-0# set virtual-chassis vcp-ports vcp-2
user@ex-0# set virtual-chassis vcp-ports vcp-3
user@ex-0# set interfaces xe-0/2/0 virtual-chassis-vc-port 2
user@ex-0# set interfaces xe-0/2/1 virtual-chassis-vc-port 3

! Automatic VCP conversion for newly added members
user@ex-0# set virtual-chassis auto-sw-update

user@ex-0# commit and-quit
user@ex-0> request virtual-chassis vc-port set interface vcp-0 member 3

Converting an uplink port to a VCP means it is no longer usable as a data port - check your uplink budget before you commit. For multi-member chassis, follow a ring topology: VCP0 of member N to VCP1 of member N+1 and close the loop. Rings survive a single link failure without splitting.

Step 3: Bring the members up and verify

user@ex-0> show virtual-chassis
user@ex-0> show virtual-chassis status
user@ex-0> show virtual-chassis vc-port
user@ex-0> show virtual-chassis protocol adjacency
user@ex-0> show virtual-chassis member 2

Virtual Chassis ID: 1a2b3c4d
Member ID  Status    Serial No    Model    Prio  Role      Mixed
0 (FPC 0)  Prsnt     ABC123       ex4300   200   Master*   No
1 (FPC 1)  Prsnt     DEF456       ex4300   128   Backup    No
2 (FPC 2)  Prsnt     GHI789       ex4300   128   Linecard  No

Every member must show Prsnt and a non-zero Role, and the VCP links must be Up in both directions. A member that appears in show virtual-chassis status but shows no VCP links is cabled to the wrong port or the port was never converted.

Mastership, split and recovery

user@ex-0> request virtual-chassis routing-engine ...            ! promotion
user@ex-0> show virtual-chassis status | match Master
user@ex-0> show chassis alarms
user@ex-0> show log messages | match -i 'vc|split'

! recover a member that lost its configuration
user@ex-1> request system zeroize
user@ex-1> request virtual-chassis renumber member 1 new-member-id 4

When a chassis splits, both fragments may run independently and both keep the same IP addresses - the classic split-brain. Fix it structurally: run a full VCP ring, avoid no-split-detection on members that can realistically split, and add a second management path so a broken fragment is still reachable. Maintain the same discipline on other vendors' stack technologies; our guides on ArubaOS-CX VSF, Dell OS10 VLT, Arista EOS MLAG and Huawei iStack vs CSS cover the same failure modes, and initial EX setup is the prerequisite step.

原文链接:https://www.juniper.net/documentation/us/en/software/junos/virtual-chassis/topics/concept/virtual-chassis-overview.html