Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[MX/PTX] How to collect "/var/log" files from Next Generation Routing Engine (NG-RE)



Article ID: KB31910 KB Last Updated: 24 Jan 2022Version: 10.0

This article describes how to collect log files from both a Junos OS VM and a Linux-based host (VMHost) in a Next Generation Routing Engine (NG-RE) hardware. The log files in the /var/log directory are required by Juniper Technical Assistance Center (JTAC) to analyze any reported incident, and tracked in a JTAC Service Request.


NG-RE is a new RE model that shares common infrastructure with multiple platforms such as MX and PTX.

The NG-RE models are as follows:

  • RE-S-X6-64G: 6-core Haswell CPU, Wellsburg PCH based Routing Engine with 64GB DRAM and 2x 64GB SSD storage for MX240/MX480/MX960

  • REMX2K-X8-64G: 8-core Haswell CPU, Wellsburg PCH based Routing Engine with 64GB DRAM and 2x 64GB SSD storage for MX2020 and MX2010

  • RE-PTX-X8-64G/CB2-PTX: 8-core Haswell CPU, Wellsburg PCH based Routing Engine with 64GB DRAM and 2x 64GB SSD storage for PTX5K​

  • ​RE-PTX-2X00x4(JNP10K-RE0) : 4-core Intel IVY Bridge CPU, Wellsburg PCH based Routing Engine with 32GB DRAM and 2x 50GB SSD storage for PTX10K

  • RE X10 (JNP10K-RE1) : 10-core Intel Broadwell-EP CPU, Wellsburg PCH based Routing Engine with 64GB DRAM and 2x 200G SSD storage for PTX10K

The NG-RE has a virtualized architecture where Junos OS runs as a virtual machine over a Linux-based host (VMHost). When the system boots, Junos OS is automatically launched. At the end of the boot, a login prompt is seen. The NG-RE is based on the popular hypervisor/emulator combination of kvm/qemu.

Junos OS is the only VM operating in the administrative context, although there is scope for expansion with other VMs in the future.

In NG-RE, there are two levels of /var/log to be collected for JTAC analysis:

  1. Junos OS VM

  2. Linux-based host (VMHost)

Steps to collect /var/log:

  1. Junos OS VM

Use the following command to zip all files under /var/log and dump it as /var/tmp/re-0-var-log.tgz.

lab> file archive compress source /var/log/* destination /var/tmp/re-0-var-log.tgz
  1. Linux-based host (VMHost)

    1. Log in to shell.

labroot> start shell
% su
  1. Log in to host.

root@:/var/home/lab # vhclient -s     
Last login: Wed Mar  1 19:34:22 CST 2017 from local-node on pts/1
  1. Zip the content.

root@local-node:~# tar -cf /var/log/<hostname>_host_VARLOG_RE<0/1>_<date>.tar -C /var/log/*
tar: Removing leading `/' from member names
root@local-node:~#  ls -l /var/log | grep VARLOG
-rw-r--r-- 1 root root 164546560 Nov 10 07:55 test_host_VARLOG_RE0_11102021.tar
  1. Copy the file to the VM Routing Engine /var/tmp.

PTX10K systems

root@ptx10008-re0-node:~# scp /var/log/test_host_VARLOG_RE0_11102021.tar root@
test_host_VARLOG_RE0_11102021.tar                                                                                                                               100%  157MB  34.6MB/s   00:04   

MX systems & PTX5K systems

root@mx2008-re0-node:~# scp /var/log/test_host_VARLOG_RE0_11102021.tar root@
test_host_VARLOG_RE0_11102021.tar                                                                                                                             100%  157MB  34.6MB/s   00:04   
  1. You can also directly copy the host logs, collected in Step (C) above, from the CLI by using the following commands:

> request vmhost file-copy from-jnode test_host_VARLOG_RE0_11102021.tar to-vjunos /var/tmp/test_host_VARLOG_RE0.tar log

To copy the file by using the above request vmhost command, mention the zip file location to /var/log/, which is done in Step C.

Example: tar -cf /var/log/test_host_VARLOG_RE0_11102021.tar -C /var/log/*

Note: In order perform the file copy operation from VMHOST to Junos OS (Step 2d,) possible users should be allowed to log in to the router via SSH as "root":

+  system {
+      services {
+          ssh {
+              root-login allow;
+          }
+      }
+  }

Now the files can be directly copied from the Routing Engine to any local host by using FTP, SCP, J-Web, or a mounted USB device.

Note: FTP, SSH and HTTP are configured under the system services stanza.

Modification History:
  • 2022-01-24: Modified steps C and D and made corrections accordingly so that the steps work fine together; feedback addressed

  • 2021-12-06: Modified a typographical error

  • 2021-12-01: Made changes in how to zip keeping in mind that there are two REs in most systems; made minor changes

  • 2021-06-11: Added a correction in Step 2e

  • 2020-03-19: Added step 2e

  • 2019-11-11: Minor correction in solution in step 2a

  • 2019-06-07: Modified step 2d, providing different commands for PTX and MX; added a note regarding ssh/root login

  • 2017-09-23: Minor correction for step 2d

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search