Skip to contentSkip to conversation

ftp connection tracking

DISCUSSION Axel Heinrici 3 participants 6 messages Jul 29, 2003

lore
Share & tools
lore
#0 lore raw

Hi

I have problem connecting to a ftp-server on a non-standard port. I remember there was an option to be set upon inserting the kernel-module. The documentation on module-options seems a little weird to me, and I can't find a clear answer.
The Situation is simple. My computer and the router/firewall have non-private IPs. Hence no Masquerading/SNAT is done. But the firewall has to be set up denying any connection going out except for services allowed explicitly. FTP is working fine (even active) when connecting to servers on port 21.
What options do I have to aply when inserting the modules?

greetings
Axel

#1 lore raw
Quoted 1 line · Axel Heinrici

I have problem connecting to a ftp-server on a non-standard port.

[...]

Quoted 1 line

What options do I have to aply when inserting the modules?

As far as I can remember :

	modprobe ip_conntrack_ftp port=21,2121

You can track 8 ports this way.

As a more general way to get modules options, use modinfo command. Unfortunately, I do not have ip_conntrack_ftp built as module, but this what you can get :

cbr@elendil:~$ modinfo bonding
filename:    /lib/modules/2.4.20/kernel/drivers/net/bonding.o
description: <none>
author:      <none>
license:     "GPL"
parm:        max_bonds int, description "Max number of bonded devices"
parm:        miimon int, description "Link check interval in
milliseconds"
parm:        mode int, description "Mode of operation : 0 for round
robin, 1 for active-backup, 2 for xor"
parm:        arp_interval int, description "arp interval in
milliseconds"
parm:        arp_ip_target string, description "arp target in n.n.n.n
form"
parm:        updelay int, description "Delay before considering link up,
in milliseconds"
parm:        downdelay int, description "Delay before considering link
down, in milliseconds"
Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
#2 lore raw

Re: ftp connection tracking (solved)

Hi

Quoted 5 lines · Cedric Blancher
Quoted 1 line · Axel Heinrici

I have problem connecting to a ftp-server on a non-standard port.

[...]

Quoted 7 lines
Quoted 1 line

What options do I have to aply when inserting the modules?

As far as I can remember :

	modprobe ip_conntrack_ftp port=21,2121

You can track 8 ports this way.

To avoid anyone is searching the archives and getting insane later..... The correct parameter is "ports" and not "port" :-)

Axel

#3 lore raw
In reply to Axel Heinrici

Hi,

I just ran into this just yesterday. I was forgetting to load ip_conntrack_ftp in my iptables init script. For grins, here is a snip from my init script:

# Firewall Modules ~ assuming modularized kernel
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp

YMMV - your modules may vary :)

ajm

Quoted 11 lines · Axel Heinrici

Hi

I have problem connecting to a ftp-server on a non-standard port. I remember there was an option to be set upon inserting the kernel-module. The documentation on module-options seems a little weird to me, and I can't find a clear answer.
The Situation is simple. My computer and the router/firewall have non-private IPs. Hence no Masquerading/SNAT is done. But the firewall has to be set up denying any connection going out except for services allowed explicitly. FTP is working fine (even active) when connecting to servers on port 21. What options do I have to aply when inserting the modules?

greetings
Axel

#4 lore raw

Hi

Quoted 5 lines · Andrew J. Meader

Hi,

I just ran into this just yesterday. I was forgetting to load ip_conntrack_ftp in my iptables init script. For grins, here is a snip from my init script:

That is not the problem. The module is loaded. But the module doesn't track FTP-connections on non-standard ports. So FTP-connections to theses servers are not "allowed" by the "iptables .... -m --state RELATED,ESTABLISHED ...."-stuff.

Quoted 8 lines

# Firewall Modules ~ assuming modularized kernel
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp

YMMV - your modules may vary :)

greetings
Axel

#5 lore raw

Ah, I see your point. I don't think I will be of much help to you. However, I'm sure someone else in the community has walked this path before. Good luck.

ajm