We're trying ftp connection from EC2 ftp client to external our server.
But we encounterd the following ftp connection problem.
We need to solve this problem.
We are very much appreciated if you could give us the solutions.
1. Problem
EC2 ftp client fail to conect to ftp Server ,
pwd or cd command can work, but ls, put and get comand cannot work.
We need to use Windows ftp command for connection.
ftp client is EC2 and have Elastic IP address
ftp server is on our office side and have grobal IP address.
2. ftp client Environment
Amazon EC2
Windows 2003 Server Instance
Windows ftp command
EC2 Elastic IP address - zz.zz.zz.zz
EC2 Internal IP address - aa.aa.aa.aa
We used EC2 as ftp client, not ftp server.
3. ftp Server Environment
ftp server is on our office Japan.
it have a grobal IP address xx.xx.xx.xx.
4. firewall security on our office
Our office -> EC2(internet) : all tcp permitted
EC2(internet) -> Our office: tcp20/21 permitted.
5. EC2 security group setting.
tcp20/21 from any IP permitted
6. EC2 ftp client Log
ftp> open xx.xx.xx.xx
Connected to xx.xx.xx.xx
220 ftp server ready.
User (xx.xx.xx.xx:(none)):
---> USER yyyyy
331 Password.
---> PASS ecopass
230 User yyyyy logged in super!
ftp> cd LogFiles\DayLog
---> CWD LogFiles\DayLog
250 CWD command succesful.
ftp> ls
---> PORT aa,aa,aa,aa,9,134
200 PORT command successful.
---> NLST
150 ASCII data.
xx.xx.xx.xx means that ftp Server grobal IP address
aa,aa,aa,aa means that EC2 Internal IP address
7. ftp Server ftp log
Session 7, Peer xx.xx.xx.xx ftp Server session started
Session 7, Peer xx.xx.xx.xx ftp Server session started
Session 7, Peer xx.xx.xx.xx USER xxxx
Session 7, Peer xx.xx.xx.xx 331 User name ok, need password
Session 7, Peer xx.xx.xx.xx ftp: Login attempt by: xxxx
Session 7, Peer xx.xx.xx.xx PASS XXXXXXX
Session 7, Peer xx.xx.xx.xx 230 User logged in
Session 7, Peer xx.xx.xx.xx ftp: Login successful
Session 7, Peer xx.xx.xx.xx PORT aa,aa,aa,aa ,5,106 <- EC2 Internal IP Address
Session 7, Peer xx.xx.xx.xx 200 PORT command successful.
Session 7, Peer xx.xx.xx.xx NLST
Session 7, Peer xx.xx.xx.xx Could not connect to peer. Aborting transfer.
Session 7, Peer xx.xx.xx.xx 226 Closing data connection
Session 7, Peer xx.xx.xx.xx QUIT
Session 7, Peer xx.xx.xx.xx 221 Service closing control connection
Session 7, Peer xx.xx.xx.xx ftp: Connection closed.
8. reason why
It seems that EC2 Internal IP address is used when ftp Server tried to
tansfer data to EC2 ftp client by TCP20.
We tried ftp PASSIVE mode by literal command, but rejected by ftp Server.
ftp> literal pasv
---> pasv
502 [pasv] Command not implemented.
W need to solve this problem.
Thank you for reading.
Message was edited by: mgcloud