ftp issue cont.
Thanks Jorg,
I get the following for lsmod :
[root@squidserver ~]# lsmod | grep conntrackip_conntrack 41497 3 ipt_state,ipt_MASQUERADE,iptable_nat
So how do I add :
ip_conntrack_ftp
ipt_conntrack
And yes it is :
-A FORWARD -j DROP
Thanks again
Varun
----- Original Message -----
From: Jörg Harmuth <[email protected]>
Date: Monday, August 15, 2005 4:29 pm
Subject: Re: ftp issue cont.
Quoted 88 lines
Quoted 3 lines · [email protected] schrieb:
Thanks Jorg,
How to find out if ftp-module is loaded or
not.e.g.
lsmod | grep conntrack
gives on my box:
ip_conntrack_ftp 3680 0 (unused) ipt_conntrack 1120 0 (autoclean) ip_conntrack 26484 1 (autoclean) [ip_conntrack_ftp ...Quoted 25 lines
Thanks
Varun
----- Original Message -----
From: Jörg Harmuth <[email protected]>
Date: Monday, August 15, 2005 2:43 pm
Subject: Re: ftp issue cont.Quoted 14 lines
Quoted 1 line · Derick Anderson
FTP passive mode creates an entirely new connection for data
transfer.> It is not 'related' to the original connection and so
iptables doesn't
Quoted 1 line
pick it up as such (nor do any other stateful firewalls that I'm
aware> of).
No, not really. Iptables regards FTP data traffic as related
stuff. To
Quoted 2 lines
Quoted 2 lines
be more exactly, the respective helper module does so (ip_conntrack_ftp.[k]o). So, normally all you have to do, is load
this
Quoted 1 line
Quoted 1 line
module, allow ESTABLISHED,RELATED traffic in and out and allow
FTP in.
Quoted 1 line
Quoted 1 line
This looks something like this (assumed that policies are DROP
and
Quoted 10 lines
Quoted 10 lines
OUTPUT is ACCEPT and also assumed that the box is directly connected to
the internet and that the FTP server is on the firewall box):modprobe ip_conntrack_ftp.[k]o
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --dport 21 --syn -j ACCEPT
This will work for active and passive FTP. If the ftp-module
isn't on
Quoted 4 lines
Quoted 4 lines
the system in question,
varun_saahas to configure the kernel correctlyand recompile as needed.BTW, the original ruleset didn't explain anything. IN|OUTPUT ==
ACCEPT
Quoted 1 line
Quoted 1 line
and in FORWARD no rule concerning FTP. So, what is this guy doing
? If
Quoted 1 line
Quoted 1 line
the FTP server is on the firewall box, there is no iptables
problem at
Quoted 1 line
Quoted 1 line
all (on this box). If not, there are no rules that permit FTP and
thus
Quoted 16 lines
Quoted 5 lines
it cannot work. The whole thing looks quite mysterious to me, includingthe -P issue Rob mentioned. May be a tiny ASCII art network picture
would clarify the situation :)Quoted 7 lines
Have a nice time,
Joerg
!DSPAM:430073677568926616419!
Quoted 6 lines · [email protected] schrieb:
Thanks Jorg,
I get the following for lsmod :[root@squidserver ~]# lsmod | grep conntrack
ip_conntrack41497 3 ipt_state,ipt_MASQUERADE,iptable_nat
Quoted 10 lines
So how do I add :
ip_conntrack_ftp
ipt_conntrackAnd yes it is :
-A FORWARD -j DROP
modprobe ip_conntrack_ftp
If you get an error message, you probably have to reconfigure the kernel. May I suggest reading some basic Linux tutorial ? You can find tuts e.g. on http://debian.org and most likely on the home page of your distribution.
Have a nice time and happy reading,
Joerg
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A good place to start might be man lsmod
Thanks,
Ron DuFresne
Quoted 22 lines · On Tue, 16 Aug 2005 [email protected] wrote:
Thanks Jorg,
I get the following for lsmod :[root@squidserver ~]# lsmod | grep conntrack
ip_conntrack41497 3 ipt_state,ipt_MASQUERADE,iptable_natSo how do I add :
ip_conntrack_ftp
ipt_conntrackAnd yes it is :
-A FORWARD -j DROPThanks again
Varun
Quoted 96 lines
----- Original Message -----
From: Jörg Harmuth <[email protected]>
Date: Monday, August 15, 2005 4:29 pm
Subject: Re: ftp issue cont.Quoted 88 lines
Quoted 3 lines · [email protected] schrieb:
Thanks Jorg,
How to find out if ftp-module is loaded or
not.e.g.
lsmod | grep conntrack
gives on my box:
ip_conntrack_ftp 3680 0 (unused) ipt_conntrack 1120 0 (autoclean) ip_conntrack 26484 1 (autoclean) [ip_conntrack_ftp ...Quoted 25 lines
Thanks
Varun
----- Original Message -----
From: Jörg Harmuth <[email protected]>
Date: Monday, August 15, 2005 2:43 pm
Subject: Re: ftp issue cont.Quoted 14 lines
Quoted 1 line · Derick Anderson
FTP passive mode creates an entirely new connection for data
transfer.> It is not 'related' to the original connection and so
iptables doesn't
Quoted 1 line
pick it up as such (nor do any other stateful firewalls that I'm
aware> of).
No, not really. Iptables regards FTP data traffic as related
stuff. To
Quoted 2 lines
Quoted 2 lines
be more exactly, the respective helper module does so (ip_conntrack_ftp.[k]o). So, normally all you have to do, is load
this
Quoted 1 line
Quoted 1 line
module, allow ESTABLISHED,RELATED traffic in and out and allow
FTP in.
Quoted 1 line
Quoted 1 line
This looks something like this (assumed that policies are DROP
and
Quoted 10 lines
Quoted 10 lines
OUTPUT is ACCEPT and also assumed that the box is directly connected to
the internet and that the FTP server is on the firewall box):modprobe ip_conntrack_ftp.[k]o
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --dport 21 --syn -j ACCEPT
This will work for active and passive FTP. If the ftp-module
isn't on
Quoted 4 lines
Quoted 4 lines
the system in question,
varun_saahas to configure the kernel correctlyand recompile as needed.BTW, the original ruleset didn't explain anything. IN|OUTPUT ==
ACCEPT
Quoted 1 line
Quoted 1 line
and in FORWARD no rule concerning FTP. So, what is this guy doing
? If
Quoted 1 line
Quoted 1 line
the FTP server is on the firewall box, there is no iptables
problem at
Quoted 1 line
Quoted 1 line
all (on this box). If not, there are no rules that permit FTP and
thus
Quoted 16 lines
Quoted 5 lines
it cannot work. The whole thing looks quite mysterious to me, includingthe -P issue Rob mentioned. May be a tiny ASCII art network picture
would clarify the situation :)Quoted 7 lines
Have a nice time,
Joerg
!DSPAM:430073677568926616419!
- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
admin & senior security consultant: sysinfo.com
http://sysinfo.com
Key fingerprint = 9401 4B13 B918 164C 647A E838 B2DF AFCC 94B0 6629
...We waste time looking for the perfect lover
instead of creating the perfect love.
-Tom Robbins <Still Life With Woodpecker>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFDAmNYst+vzJSwZikRAokXAJ47aeytIFGoZOoWdxPPTbkz3U587QCgwpN5 GS3EPRxQi7Jf/t+dC/1UhDk=
=GPSL
-----END PGP SIGNATURE-----