如何更改haproxy的ftp被动模式ip地址作为备用代理服务器?

我有一个局域网中的ftp服务器,地址是192.168.1.11我用haproxy是因为很多其他的服务需要它

我把haproxy放在我的软路由(192.168.1.1)上(ubuntu 14.04)

我的haproxyconfiguration是:

frontend ao3-ftp bind ftp.ao3.com.au:21 bind ftp.ao3.com.au:20 bind ftp.ao3.com.au:5000-5100 default_backend myftp backend myftp server server1 192.168.1.11 

当客户端使用FTP服务时,他们发现无法连接的IP地址的问题:

 Status: Connected, waiting for welcome message... Reply: 220-FileZilla Server version 0.9.41 beta Reply: 220 Hi welcome to Ao3 ftp Server Reply: 200 Don't care Command: USER ingram Reply: 331 Password required for ingram Command: PASS *********** Reply: 230 Logged on Command: SYST Reply: 215 UNIX emulated by FileZilla Command: FEAT Reply: 211-Features: Reply: MDTM Reply: REST STREAM Reply: SIZE Reply: MLST type*;size*;modify* Reply: MLSD Reply: UTF8 Reply: CLNT Reply: MFMT Reply: 211 End Command: PWD Reply: 257 "/" is current directory. Status: Current path is / Command: TYPE I Reply: 200 Type set to I Command: PASV Reply: 227 Entering Passive Mode (192,168,1,11,19,144) ---here the problem Error: Server returned unroutable private IP address in PASV reply 

你可以看到IP地址仍然是我的内部networkingIP地址,所以外面的公司客户端不能转移数据,因为它找不到这个IP地址。 haproxy是否提供了一些方法来将他们的内部IP地址改为外部IP地址? iptables能做到吗?

只需要FileZilla FTP服务器宣布HA-proxy使用的正确的外部IP地址,这是你可以在选项 – >被动模式设置

通常Linux内核使用助手模块来扫描明文FTP命令通道来响应PASVdynamic地将其转换为正确的NAT响应和/或dynamic地打开iptables中的相关networking端口,但是我不知道HA-代理有这样一个FTP协议的帮手。