iptables rules for inbound and outbound FTP connections
Hi,
I know iptables is a lot discussed here around, but I couldn't quite find the global answer to my problem yet. First: Can anyone explain to me how does FTP request get out from FTP client, and get in to FTP Server, and then how they get back out from server back in to client ? On what ports and why ? Second: That explained will help a lot I'm sure. Because to define the correct rules, it seems essential to understand how the protocol works. These are the rules I set for my FTP server, and for this server to get out with its ftp client for backup purpose: Let's say this rules are on SERVER A, and my backup server is SERVER B: Code:
# Allow incoming FTP connections But then, if I do an "ls" for example, the reply does not get in. If I remove all rules and accept all, it works. Therefore, these rules are wrong somewhere.... But I can't figure out where. If anyone can help ? and most of all, explain, for me to learn. Note that my default policy is DROP for INPUT, OUTPUT and FORWARD. |
you really want to look at using connection tracking proeprly here, it makes it pretty simple:
http://rackerhacker.com/2007/07/01/a...ough-iptables/ |
All times are GMT -5. The time now is 06:11 AM. |