<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>EnterpriseDT Q&amp;A - Recent questions and answers in FAQ: edtFTPj/Free</title>
<link>https://enterprisedt.com/questions/index.php/qa/faq/faq-edtftpj-free</link>
<description>Powered by Question2Answer</description>
<item>
<title>edtFTPj/Free: on passive mode returns private IP</title>
<link>https://enterprisedt.com/questions/index.php/11348/edtftpj-free-on-passive-mode-returns-private-ip</link>
<description>&lt;p&gt;I&#039;m experiencing problems with edtFTPj, deployed on AWS: regardless of what settings I set in advanced connection/server settings I&#039;m getting &quot;Error: Server returned unroutable private IP address in PASV reply &quot; testing my server with &lt;a href=&quot;https://ftptest.net/&quot; rel=&quot;nofollow&quot;&gt;https://ftptest.net/&lt;/a&gt; and in server logs I see:&lt;/p&gt;

&lt;p&gt;2016-04-19 06:21:48 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: PASS *****&lt;br&gt;
2016-04-19 06:21:48 INFO&amp;nbsp; PASS:246 - Login success - test2&lt;br&gt;
2016-04-19 06:21:48 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 230 User logged in, proceed.&lt;/p&gt;

&lt;p&gt;2016-04-19 06:21:48 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: TYPE I&lt;br&gt;
2016-04-19 06:21:48 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 200 Command TYPE okay.&lt;/p&gt;

&lt;p&gt;2016-04-19 06:21:59 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: MKD 945811551&lt;br&gt;
2016-04-19 06:21:59 INFO&amp;nbsp; MKD:109 - Directory create : test2 - /945811551&lt;br&gt;
2016-04-19 06:21:59 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 257 &quot;/945811551&quot; created.&lt;/p&gt;

&lt;p&gt;2016-04-19 06:22:01 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: CWD 945811551&lt;br&gt;
2016-04-19 06:22:01 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 250 Directory changed to /945811551&lt;/p&gt;

&lt;p&gt;2016-04-19 06:22:07 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: SYST&lt;br&gt;
2016-04-19 06:22:07 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 215 UNIX Type: Apache FtpServer&lt;/p&gt;

&lt;p&gt;2016-04-19 06:22:07 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: PWD&lt;br&gt;
2016-04-19 06:22:07 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 257 &quot;/945811551&quot; is current directory.&lt;/p&gt;

&lt;p&gt;2016-04-19 06:22:07 INFO&amp;nbsp; FtpLoggingFilter:84 - RECEIVED: PASV&lt;br&gt;
2016-04-19 06:22:07 INFO&amp;nbsp; FtpLoggingFilter:157 - SENT: 227 Entering Passive Mode (172,31,30,187,200,147)&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
where 172.31.30.187 is mu EC2 instance&#039;s private IP.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;in code:&lt;/p&gt;

&lt;pre&gt;
            ftp.setRemoteHost(AppConstants.FTPServer.&lt;em&gt;HOST&lt;/em&gt;);
            ftp.setRemotePort(AppConstants.FTPServer.&lt;em&gt;PORT&lt;/em&gt;);
            ftp.setUserName(username);
            ftp.setPassword(password);&lt;em&gt;
&lt;/em&gt;&lt;em&gt;      &lt;/em&gt;ftp.getAdvancedFTPSettings().setActiveIPAddress(AppConstants.FTPServer.&lt;em&gt;HOST&lt;/em&gt;);
            ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.&lt;em&gt;PASV&lt;/em&gt;);
            ftp.getAdvancedFTPSettings().setAutoPassiveIPSubstitution(&lt;strong&gt;true&lt;/strong&gt;); &lt;em&gt;// AWS has problems with this
&lt;/em&gt;&lt;em&gt;            &lt;/em&gt;ftp.getAdvancedFTPSettings().setActivePortRange(&lt;span style=&quot;color:#0000ff&quot;&gt;3000&lt;/span&gt;, &lt;span style=&quot;color:#0000ff&quot;&gt;4000&lt;/span&gt;);&lt;/pre&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;where AppConstants.FTPServer.&lt;em&gt;HOST value in my public IP, I&#039;m 100% sure with logs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What I do wrong and how to fix this?&lt;/em&gt;&lt;/p&gt;</description>
<category>FAQ: edtFTPj/Free</category>
<guid isPermaLink="true">https://enterprisedt.com/questions/index.php/11348/edtftpj-free-on-passive-mode-returns-private-ip</guid>
<pubDate>Tue, 19 Apr 2016 07:15:44 +0000</pubDate>
</item>
</channel>
</rss>