Skip to contentSkip to conversation

ip_nat_ftp module and freeswan IPSEC module don't work together?

DISCUSSION Rodre Ghorashi-Zadeh 2 participants 2 messages Jan 23, 2004 – Jan 27, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

I am having a really weird problem with the ip_nat_ftp module and the [Free S/WAN] ipsec module. When I have the ipsec module loaded (with or without any tunnels configured) the FTP Data connections to any active type FTP servers get screwed up. What happens is that I am able to connect and login to the server, I am able to do an 'ls' or 'get' operation once. On subsiquent operations that require the use of the data channel the system hangs. I used tcpdump on the firewall to see what 'PORT' commands where being sent to the server. This is where I noticed that the first 'PORT' command was getting it's IP address rewritten from the clients internal address to the clients external address, thus the ip_nat_ftp module works as expected. However, on subsiquent 'PORT' commands, from within the same FTP session, the IP address in the 'PORT' command is my client machines internal IP address, so the remote server freaks out and drops (TCP RESET) the connection. If I stop the IPSEC service (unload ipsec.o module) the 'PORT' commands internal IP address gets rewritten to the clients external IP adddress each and every time I do a 'get' or 'ls' operation.

Now the really wierd part. When I have the IPSEC module loaded and a tunnel configured, and I use FTP to access an FTP server that resides on the other end of the tunnel the ip_nat_ftp module is able to rewrite the 'PORT' commands IP address each and every time, hence the active FTP works like a charm through the tunnel. Weird Huh?

I am using kernel 2.4.20, iptables 1.2.8, patch-o-matic 20030107, and Free S/WAN 2.01.

Any help regarding this matter would be greatly appreciated. Thanks in advance.

®odre

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca

#1 lore raw
Quoted 4 lines · Rodre Ghorashi-Zadeh

Hello,

Any help regarding this matter would be greatly appreciated. Thanks in advance.

I have no idea how this could be caused. But it seems to me at the first glance, that this is not a netfilter/iptables issue. It works with a stock kernel... Maybe you should talk to the freeswan guys and ask if somebody is able to come up with an explanation.

Also, please submit bug reports via bugzilla.netfilter.org instead of posting to the mainlintlist, please.

thanks.

Quoted 1 line

?odre

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie