amazon-web-servicesamazon-ec2ftppureftpd

AWS EC2 Passive FTP - Server sent passive reply with unroutable address. Using server address instead


I have pureftp running on an AWS ec2 instance. I'm trying to get it to run in passive mode which I thought was working, however I'm finding it may not be working correctly. I'm receiving the following error in FileZilla

Status:         Connected
Status:         Retrieving directory listing...
Status:         Server sent passive reply with unroutable address. Using server address instead.
Status:         Directory listing of "/" successful

The odd part is some people are unable to log in while others are.

I have the following pureftp configuration

Port Range

#Port range for passive connections replies. - for firewalling.

PassivePortRange `50000 50100`

PASV IP

#Force an IP address in PASV/EPSV/SPSV replies. - for NAT.
#Symbolic host names are also accepted for gateways with dynamic IP
#addresses.

ForcePassiveIP            `ftp.mydomain.com` "my cname record is mapped to my ec2 public dns"

When I view the local port range on the server, /proc/sys/net/ipv4/ip_local_port_range the following are open.

32768   61000

My ec2 security group has port 50000 - 50100 open

When I view my server logs I don't see much other than this every once in a while.

Feb  5 08:57:41 ip-172-11-42-52 dhclient[1062]: DHCPREQUEST on eth0 to 172.11.32.1 port 67 (xid=0x601547fd)
Feb  5 08:57:41 ip-172-11-42-52 dhclient[1062]: DHCPACK from 172.11.32.1 (xid=0x601547fd)
Feb  5 08:57:43 ip-172-11-42-52 dhclient[1062]: bound to 172.11.42.52 -- renewal in 1417 seconds.

Anybody have any idea where things might be going wrong?


Solution

  • So I believe I resolved this issue. It appears as if aws was dynamically changing ip addresses. When I was referencing ftp.domain.com for my passiveip the ip that it resolved to didn't match the initial ip tied to the cname record.

    The solution was to assign a static elastic ip to my ec2 instance and set my passiveip in pureftp to my static elastic ip. Thus far it appears to have resolved my issue.