LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Proftpd passive connections (https://www.linuxquestions.org/questions/linux-networking-3/proftpd-passive-connections-454152/)

gabsik 06-12-2006 06:51 PM

Proftpd passive connections
 
I stopped passive connections,they open a too big hole in my firewall 60000:65535 .So to stop it i'm using :
Quote:

<Global>
<Limit EPSV PASV>
Deny All
</Limit>
</Global>
taken from proftpd.org ... but i can't connect anymore to my ftp ... My question is:how much important are passives connnections in ftp,second:can i by connection tracking in iptables do without opening a hole of 55535 ports ??
Thanks.

:tisk:

gabsik 06-14-2006 09:02 PM

I don't think i'm asking the world ... (lots of my posts stay to 0 ... )
Anyway i saw passive connections are important for ftp the problem is on the firewall script for a ftp server behind NAT.
On proftpd i have PassivePorts 60000 65534
Quote:

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
$IPT -t nat -I PREROUTING -p tcp -i eth0 -d 192.168.0.2 --dport 60000:65534 --to 192.168.1.6:60000:65534
offcourse that's wrong:
Quote:

iptables v1.2.11: Unknown arg `--to'
Try `iptables -h' or 'iptables --help' for more information.
How do i make a prerouting for a range of ports ???
Simple isn't ???

Notwerk 06-15-2006 03:23 AM

Your firewall rule doesn't tell iptables what to do with packets that match it. So you'll need to add a "if-the-packet-matches-DO-SOMETHING". This *something*, I'm assuming, is DNATing. So here's how the rule should look like:
Code:

$IPT -t nat -I PREROUTING -i eth0 -d 192.168.0.2 -p tcp --dport 60000:65534 -j DNAT --to-address 192.168.0.6

gabsik 06-16-2006 08:23 PM

That's how i' m doing and my ftp doesn't work .... STILL!
Quote:

$IPT -t nat -I PREROUTING -p tcp -i eth0 -d 192.168.0.2 --dport 60000:65534 -j DNAT --to 192.168.1.6:60000-65534
Would you give it a try ftp://ftp.gabrix.ath.cx feel free
I missed -j DNAT in the post, not in reality but still ... i would avoid passive connections too many ports to open.
Would be nice a module allowing ftp related connections and who is not, dropped by iptables default.( ??? )

Notwerk 06-17-2006 02:08 AM

Tried to connect to the link provided, but no go.

Could you provide more details about your setup:
1) There seems to be 2 private network (192.168.0.0 & 192.168.1.0), is this correct?

Quote:

...the problem is on the firewall script for a ftp server behind NAT
2) Are you applying the firewall rules at the router?

3) Did you try this?
Code:

... -j DNAT --to-address 192.168.1.6

gabsik 06-18-2006 06:18 AM

I have configured proftpd PassivePorts 60000:65534 on the router ports 20 ,21 and 60000:65534 are open (???) the linuxbox has default input DROP and all this ports are allowed in PREROUTING and DNATted to the FORWARDS chain where offcourse are all allowed ... proftpd looks easy ...


All times are GMT -5. The time now is 11:51 AM.