juniper srx: useful commands

Will update this post as I find useful commands.

Reset dynamic VPN due to connectivity issues: restart ipsec-key-management

Show logged on users: show system users
Logout connected user: request system logout user username terminal session

Show open sessions: show security flow session
View running Junos applications: show configuration groups junos-defaults applications
Show current sessions: show security flow session

Show system snapshot: show system snapshot media internal
Show system software backup: show system software backup

Delete autorecovery config: request system autorecovery state clear
Save autorecovery config: request system autorecovery state save

Delete rescue config: request system configuration rescue delete
Save rescue config: request system configuration rescue save

Upgrade bootloader: go to shell by typing “start shell” in cli
bootupgrade –u /boot/uboot –l /boot/loader

View BIOS version: show chassis routing-engine bios
View BIOS version and available upgrade: show system firmware
View current and upgrade BIOS with backup: request system firmware upgrade re bios backup
Check status of BIOS upgrade: show system firmware

View contents of a directory: file list directory
Show system directory usage: show system directory-usage /cf
Check disk space: show system storage detail
View contents of a directory: file list directory
Delete a file: file delete /var/tmp/xyz

Cleanup storage space: request system storage cleanup
Delete upgrade package backup: request system software delete-backup

Show device name, model and software version: show version

Upgrade software through ssh: put a copy of Junos software on a ftp location your device can access upon connecting (do not put where you have to browse to after connection). This needs to be done right after you are logged on to the device, and not in cli.

Login to ftp: ftp ip
Change directory to /var/tmp: lcd /var/tmp
Type bin and hit enter
Command to download the file to device: get junos-srxsme-12.1X46-D40.2-domestic.tgz
Type bye to exit ftp mode when file is downloaded successfully and go to cli.
Invoke the following command to install: request system software add no-copy /var/tmp/junos-srxsme-12.1X46-D40.2-domestic.tgz
Install may take a hot minute so be patient. Once this is complete reboot your device: request system reboot

Juniper Junos: change timeout settings for ssh/telnet/web console

To change application timeout:
cli/configure
ssh: set applications application junos-ssh inactivity-timeout 1440
telnet: set applications application junos-telnet inactivity-timeout 1440
web: set system services web-management session idle-timeout 1440

Note: auto complete does not work after application, so you will have to type it all in.

To view timeout settings, exit to cli
start shell user root
vty fwdd
show usp app-def tcp

And you’re done.