--On Tuesday, May 21, 2002 2:05 PM +0000 a b <[EMAIL PROTECTED]> wrote:
> My question is:
>
> What happens if I have the following NAT ruleset and two hosts
> on my private LAN connects to the same external FTP server and
> by coincidence happens to pick the same port for the FTP data
> transfer? Wouldn't the responses get mixed up. IPFILTER has
> no chance to pass the packets to the right host.
Let's examine the data flows:
Inside | Outside
Ip1:P1 -> S1:21 | IpN:PN1 -> S1:21
Ip1:P2
Ip2:P3 -> S1:21 | IpN:PN2 -> S1:21
Ip2:P2
If Ip1 sends a PORT Ip1,P2 - ipf will re-write it as PORT IpN,P2
If Ip2 then sends PORT Ip2,P2 - what does ipf do?
Sadly, it sends PORT IpN,P2
Tested via:
(echo -e "user ftp\r"; sleep 2; echo -e "pass ftp@\r"; sleep 2; echo -e
"PORT my,i,p,addr,5,1\r") | nc ftp.ser.ver 21
On 2 systems, both send ,5,1 to the ftp server.
THIS IS A BUG
ipf should track the data connections in use, and re-write the port number
in a PORT command such that it does not conflict. This is what application
proxies do (of course, they usually rewrite _all_ port numbers, so...). I
don't have access to other packet filters to determine their behaviour.
--
Carson