I have following configuration:
FTP client (public_IP1) => internet => Firewall(Public_IP2) => FTP server (10.10.12.171
)
I have following iptables rules at Firewall
:
DNAT tcp -- 0.0.0.0/0 Public_IP2 tcp dpt:21 to:10.10.12.171
MASQUERADE all -- 10.0.0.0/8 0.0.0.0/0
I have also nf_conntrack_ftp
loaded at Firewall
nf_conntrack_ftp 13057 0
nf_conntrack 79944 6 nf_conntrack_ftp,nf_conntrack_ipv4,nf_nat,iptable_nat,vzcpt,vzrst
In active mode everything works perfect. In passive mode I have following error (at client):
ftp> passive
Passive mode on.
ftp> dir
227 Entering Passive Mode (10,10,12,171,86,26)
ftp: connect: No route to host
I guess client tends to connect to my private IP (10.10.12.171
). How to change it?