Support Support Downloads Knowledge Base Case Manager My Juniper 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

[ScreenOS] Redirect output to a TFTP server

0

0

Article ID: KB6614 KB Last Updated: 14 Dec 2017Version: 5.0
Summary:
How To: Redirect output to a TFTP server
Symptoms:

Here is the problem or goal:

  • Capture data to a text file
  • How To: Redirect output to a TFTP server
  • You may get the following errors while trying to redirect the output to UNIX, LINUX, or BSD Operating System
              !rcv tftp error(2) Access violation
              !rcv tftp error(2) File Not Found
Solution:

You can redirect any "get" output to a file on a TFTP server.  This is a CLI only command, and the syntax is as follows:

get [command-name]  > tftp <tftp IP address> <filename>


Now, let us explain with an example how to redirect the output to a TFTP server running on Windows, as well as UNIX/LINUX/BSD


How to redirect the output to a TFTP server running on Windows OS:

For example, assume you want to re-direct the get session output to a file called session.txt on your TFTP running on your Windows OS, then you need to issue the following command:

get session > tftp 192.168.1.1 session.txt

In Windows OS,  you do not need to create the file session.txt before redirecting the output, as the above command will create that file in the default directory of TFTP server automatically.


How to redirect the output to a TFTP server running on UNIX/LINUX/BSD OS:

If the TFTP server is on a UNIX, LINUX, or BSD Operating System, you first need to create the file that you want the "get" output to re-direct to and with Linux, you need to specify the entire path for the filename .

For example, assume you want to re-direct the get session output to a file called session.txt on your TFTP server on your Linux operating system.

Create the file first:

touch session.txt

You now have to give write permissions to that file.  If you do an ls on session.txt, you may see the following:

-rw-r--r--  1 root  admin     20 Jun 17 08:21 session.txt

Change the file so that you have write permissions:

chmod 666 session.txt

To verify you have write permissions set, do another ls -l session.txt:

-rw-rw-rw-  1 root  admin  1795 Jun 29 09:21 session.txt

Now, you can issue your get session command, and it will be re-directed to your TFTP server:

get session > tftp 10.251.7.50 /tftpboot/session.txt
redirect to 10.251.7.50,/tftpboot/session.txt
!!!!!!!!!!
tftp transferred records = 4
tftp success!
Modification History:
2017-12-07: Article reviewed for accuracy. No changes made. Article is correct and complete.

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