Juniper Switching CLI & J-Web - A Collection
This page is for the Juniper Switching CLI or J-Web interfaces which don't all need separate pages. You can search for them with Ctrl + F or click the "Search" at the top.
The terminology used in this documentation is listed below:
• Run – Run the command and press enter. No other interaction needed. No output will appear.
• Type – Type a word, most of the time being Boolean (yes/no, true/false).
Configuring Virtual Chassis EX Series
Sadly, this takes you to a PDF and you need to use Wayback machine to get the snapshot of:
https://web.archive.org/web/20231201042147/https://www.juniper.net/documentation/us/en/software/junos/virtual-chassis-ex-4200-4500/topics/task/virtual-chassis-ex4200-cli.html
Enabling J-Web Interface
Connect the COM cable or use the IP address of the system and SSH to it. Login as normal.
Run cli
Run edit
Run delete interfaces
Run set interfaces vlan.0 family inet address 192.192.0.x
(replacing x with the end IP for the management interface)
Run commit
Wait for synchronization to complete.
Description: We have removed all interfaces and configured the vlan.0 interface to 192.192.0.x, x being the end of the switches management IP address temporarily. Without this being set, the switch will complain that no interfaces have been configured for vlan.0.
Run set interfaces vme unit 0 family inet address 192.168.0.x/<subnet>
(replacing x with the IP for management interface, the vme IP)
Run set system services ssh root-login allow
Run set system services web-management management-url 192.168.0.x/root
(replacing x with the IP for management interface web portal, same as the vme IP set earlier)
Run set system services web-management http interface vme
Run set system services web-management https port 443
Run set system services web-management https system-generated-certificate
Run set system services web-management https interface vme
Run commit
Wait for synchronization to complete.
Description: We have updated the management interface, J-Web, to show the webpage instead of “Connection Refused”. This is believed to be happening because of it binding the interface to me0, not vme, which is the virtual chassis interface. Citation Needed.
Switching Between Primary Master & Backup Switches
Connect the COM cable or use the IP address of the system and SSH to it. Login as normal.
Taken from: https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/command/request-chassis-routing-engine-master.html
Run cli
Run request chassis routing-engine master switch
Type yes
You will be disconnected after about 1-2 seconds on the switch you are connected on (either master or backup) and you will need to wait around 5 minutes before issuing this command again.
Save Time With Making Synchronize Default
This section allows you to set the command commit to always run commit synchronize without you needing to write that word afterwards.
Connect the COM cable or use the IP address of the system and SSH to it. Login as normal.
Run cli
Run edit
Run set system commit synchronize
Run commit synchronize
On next command run of commit, it will run commit synchronize. This should be visibly apparent that it worked as you will see fpc0 and fpc1 sync along the left when committing between them when in virtual-chassis mode.
Switching ROM On Switch
Connect the COM cable to the switch you wish to switch ROM on. This is good for getting to a different firmware version if it decided to downgrade due to not being the same, configuration resync or getting back from Linecard to Master/Backup due to version issue.
Note: Due to the command request session member X, a COM cable isn’t required.
Run request system reboot slice alternate media internal
Type yes
Wait for switch to restart. This will countdown on 60 seconds, 30 seconds and immediately, respectively.
Syncing Current ROM With Redundant ROM
SSH or connect the COM cable and run the command below to sync the current system configuration and OS version to the redundant ROM AND between both the fpc0 and fpc1.
Run cli
Run edit
Run run request system snapshot slice alternate
Get Full System Info From Both Switches (Virtual Chassis)
Obtain the system information from both switches such as the state, temperature, memory and CPU usage, model, serial number and last reboot reason.
Run cli
Run show chassis routing-engine
Login To Alternative Switch In CLI Mode For Logs/Configuration
To get into an additional member of the virtual chassis, you can run the below command to access it instead of running the switch routing-engine command. For example, member 0 is top switch, member 1 is bottom switch if running in a 2 system virtual-chassis. Replace X with the switch member number. For locating the number, you can Run show virtual-chassis to view member numbers.
Run cli
Run request session member x