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

[MX] Setting or changing the FTP mode 'Active' or 'Passive'

0

0

Article ID: KB31527 KB Last Updated: 31 Mar 2017Version: 1.0
Summary:
This article provides an explanation of the default FTP modes on Junos OS 14.2 and Junos OS 15.1. It also provides an explanation on how to change the mode.
Symptoms:

Junos OS 14.2 utilizes FTP 'Active' mode as default:

user@MX240> ftp xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx.
220 yyyyy.juniper.net FTP server (Version 6.00LS) ready.
Name (xxx.xxx.xxx.xxx:yyy): <user>
331 Password required for <user>.
Password:
230 User <user> logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I.
ftp> cd /homes/<user>
250 CWD command successful.
ftp> get <filename>.txt
local: <filename>.txt remote: <filename>.txt
200 PORT command successful.
150 Opening BINARY mode data connection for '<filename>.txt' (144 bytes).
  0% |                       100% |************************************|   144      00:00 ETA
226 Transfer complete.
144 bytes received in 0.02 seconds (5.69 KB/s)
ftp>

Junos OS 15.1 utilizes FTP 'Extended Passive' mode as default:

user@MX240> ftp xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx.
220 yyyyy.juniper.net FTP server (Version 6.00LS) ready.
Name (xxx.xxx.xxx.xxx:yyy): <user>
331 Password required for <user>.
Password:
230 User <user> logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I.
ftp> cd /homes/<user>
250 CWD command successful.
ftp> get <filename>.txt
local: <filename>.txt remote: <filename>.txt
229 Entering Extended Passive Mode (|||49727|)
150 Opening BINARY mode data connection for '<filename>.txt' (144 bytes).
100% |*****************************************************************|   144       5.41 KiB/s    00:00 ETA
226 Transfer complete.
144 bytes received in 00:00 (5.40 KiB/s)
ftp>
Cause:

On MX Series (MX240, MX480, MX960, and MX2000), Junos OS 14.2 utilizes 'Active mode' by default, and Junos OS 15.1 utilizes 'Extended Passive mode' by default.

Junos OS 14.2 supports legacy FreeBSD version 6.3, and the Junos OS 15.1 supports FreeBSD version 10. Hence, from Junos OS 15.1, the default FTP mode was changed from 'Active' to 'Extended Passive'.

On the other hand, MX-series (MX80 and MX104) utilizes 'Active' FTP mode as default, regardless of the Junos OS version.

The FTP mode 'Active' or 'Passive' on all Junos OS devices can be changed using the passive off/on switch option.

Solution:

The FTP mode can be changed by using the passive off/on switch.
ftp>‚Äč passive off  : Active mode
ftp> passive on  : Extended Passive mode

Junos OS 15.1

user@MX240> ftp xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx.
220 yyyyy.juniper.net FTP server (Version 6.00LS) ready.
Name (xxx.xxx.xxx.xxx:yyy): <user>
331 Password required for <user>.
Password:
230 User <user> logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I.
ftp> cd /homes/<user>
250 CWD command successful.
ftp> passive
Passive mode: off; fallback to active mode: off.
ftp> passive off
Passive mode: off; fallback to active mode: off.
ftp> get <filename>.txt
local: <filename>.txt remote: <filename>.txt
200 EPRT command successful.
150 Opening BINARY mode data connection for '<filename>.txt' (144 bytes).
100% |********************************************************************|   144        0.44 KiB/s    00:00 ETA
226 Transfer complete.
144 bytes received in 00:00 (0.44 KiB/s)
ftp>

ftp> passive on
Passive mode: on; fallback to active mode: off.
ftp> get <filename>.txt
local: <filename>.txt remote: <filename>.txt
229 Entering Extended Passive Mode (|||64140|)
150 Opening BINARY mode data connection for '<filename>.txt' (144 bytes).
100% |********************************************************************|   144        0.66 KiB/s    00:00 ETA
226 Transfer complete.
144 bytes received in 00:00 (0.66 KiB/s)
ftp> 

user@MX240> start shell
% ftp xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx.
220 yyyyy.juniper.net FTP server (Version 6.00LS) ready.
Name (xxx.xxx.xxx.xxx:yyy): <user>
331 Password required for <user>.
Password:
230 User <user> logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> passive
Passive mode on.
ftp> passive off
Passive mode off.
ftp> passive on
Passive mode on.
ftp>

Similarly, Junos can alter the FTP mode (active or passive) to send archived files to a FTP server with the following prefixes:

Active FTP: ftp://
Passive FTP: pasvftp://

[Active mode]
user@MX240> request support information |save ftp://<user>:<pwd>@xxx.xxx.xxx.xxx/<filename>.txt
ftp://<user>:<pwd>@xxx.xxx.xxx.xxx/<filename>.txt  100% of  481 kB   11 MBps
Wrote 9263 lines of output to 'ftp://<user>:<pwd>@xxx.xxx.xxx.xxx/<filename>.txt'

[Passive mode]
user@MX240> request support information |save pasvftp://<user>:<pwd>@xxx.xxx.xxx.xxx/<filename>.txt
pasvftp://<user>:<pwd>@xxx.xxx.xxx.xxx/<filename>.txt  100% of  481 kB    9 MBps
Wrote 9263 lines of output to 'pasvftp://<user>:<pwd>@xxx.xxx.xxx.xxx/<filename>.txt'

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