|
IPTABLES: Why does FTP need auth packets?
I am in the process of setting up an iptables firewall for one of my boxes and its at about 98% right now. The only thing that isn't working correctly is a slow FTP startup process. When I connect to the server, the connection hangs for a few seconds, then logs in and everything continues at normal speeds. I am using active FTP to get around my router-in-a-box that connects to the internet.
I set up some logging in the firewall to try and figure out what is going on. According to the logs, it turns out that the server is trying to send a series of SYN packets on port 113 (the auth port AFAIK) to the client box a few seconds BEFORE the FTP session is succesfully opened. The firewall is blocking this (as it probably should be), but I am curious 1) why it is trying to do this, and 2) if it is neccesary why iptables doesn't see the state of these packets as RELATED or ESTABLISHED to the FTP connection and allow them that way. I see this in the logs every time I connect to the server via FTP. Below is a segment of my firewall if that will help. TIA.
INPUT (policy DROP):
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp state NEW,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp spt:ftp state ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data state RELATED,ESTABLISHED
OUTPUT (policy DROP):
ACCEPT tcp -- anywhere anywhere tcp spt:ftp state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp state NEW,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp spt:ftp-data state RELATED,ESTABLISHED
|