Skip to contentSkip to conversation

ftp configurion in iptables

DISCUSSION Kashif Latif 1 participant 1 message Mar 26, 2003

lore
Share & tools
lore
#0 lore raw

Hello Sir,

I am getting problem in ftp. I configured firewall on Linux 8.0 with Iptables. I did this configuration

iptables -A INPUT -p tcp --sport 21 -m state --state ESTABLISHED -j
ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 1024: --dport 1024: -m state
--state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 1024: --dport 1024: -m state --state ESTABLISHED,RELATED -j ACCEPT

For Nat

iptables –t nat -A POSTROUTING -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j MASQUERADE
iptables –t nat -A POSTROUTING -p tcp --sport 1024: --dport 1024: -m state --state ESTABLISHED,RELATED -j MASQUERADE

Users from NAT are able to connect to remote FTP server but when they type dir, ls commands. It returns error connection closed by remote machine.

How can I configure NAT then user from their machine able to FTP on remote server.

Please give me solution to solve this problem.

Regards,

****************************************
Kashif Latif
Network Support Officer
Innovative Pvt Ltd.
****************************************