Article View: linux.redhat.misc
Article #14IPCHAINS & FTP
From: Frederic Breitwieser
Date: Thu, 13 Apr 2000 00:00
Date: Thu, 13 Apr 2000 00:00
31 lines
1998 bytes
1998 bytes
Greetings,
I've made a lot of progress on my RH6.0 / IPCHAINS firewall recently, but I
still struggle with the FTP portion. The firewall has a public IP on one
side (eth0) and 192.168.1.1 (eth1) on the private side, with the FTP server
being 192.168.1.10. Here is a snippet of my script, and ip_masq_ftp is in
fact loaded. I have all the ports 1024:65535 enabled for full outgoing
access, from the 192.168.1.0 segment to the internet. I attempted to add a
rule that enables port 20 to originate and go out, but that didn't fly
either.
I'm sure you folks have been asked this no less than 2106 times, but a week
of surfing didn't result in enough understanding on my part whereas I could
make this work. Thanks in advance!
#!/bin/sh
IPCHAINS="/sbin/ipchains"
REMOTENET="0/0"
LOCALNET=$1
# $1 is the public ip/subnet passed into the script.
<snip>
# ENABLE SPECIFIC SERVICES
# ftp-data (20) and ftp (21)
$IPCHAINS -A input -p tcp -s $REMOTENET -d $LOCALNET 20 -j ACCEPT
$IPCHAINS -A input -p tcp -s $REMOTENET -d $LOCALNET 21 -j ACCEPT
$IPMASQADM portfw -a -P tcp -L $LOCALIP 20 -R 192.168.1.10 20 -p 1
$IPMASQADM portfw -a -P tcp -L $LOCALIP 21 -R 192.168.1.10 21 -p 1
Technical Details
Message-ID:
<8d4i4i$s85$1@bob.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd6c,ff637019f73c8273,start X-Google-Attributes: gidfcd6c,public X-Google-Thread: 111240,ff637019f73c8273,start X-Google-Attributes: gid111240,public X-Google-Thread: 11033e,ff637019f73c8273,start X-Google-Attributes: gid11033e,public From: "Frederic Breitwieser" <frederic@xephic.dynip.com> Subject: IPCHAINS & FTP Date: 2000/04/13 Message-ID: <8d4i4i$s85$1@bob.news.rcn.net> X-Deja-AN: 610660202 X-Trace: TwEwGLv4QJdAc/xQL9y4a1f15gc90GV/Ozs+w7rcv6KOH3hHy+9XGg== NNTP-Posting-Date: 13 Apr 2000 13:29:54 GMT Newsgroups: linux.redhat.misc,linux.redhat.install,ahn.tech.linux X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@rcn.com