FTP problem with IPTABLES
From: Karl Bickmore (kbickmore_at_cox.net)
Date: 07/12/03
- Next message: Pascal Nobus: "SPS VPN IPsec"
- Previous message: Rich Piotrowski: "Re: changing the order of NICs"
- Next in thread: ryan: "Re: FTP problem with IPTABLES"
- Reply: ryan: "Re: FTP problem with IPTABLES"
- Reply: Robert Jirik: "Re: FTP problem with IPTABLES"
- Reply: Karl Bickmore: "Re: FTP problem with IPTABLES"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 11 Jul 2003 18:30:19 -0700
I have a Redhat 9.0 system running as a Firewall and email server. I have
configured SNAT and everything seems to be fine except an issue with FTP.
Clients behind the firewall can login to a remote FTP site, they can CD, but
can't ls, put or get. Below are the rules in the firewall script I have for
FTP:
#I have not inlcuded all of the variables for this post, but I did add some
to help you read this.
UNPRIVPORTS="1024:65535"
EXTERNAL_INTERFACE ="eth0"
ANYWHERE="0.0.0.0/0"
iptables -A INPUT -i $EXTERNAL_INTERFACE -p TCP -m state --state
ESTABLISHED,RELATED \
--sport 21 --dport $UNPRIVPORTS -s $ANYWHERE -d $EXTERNAL_IP -j ACCEPT
iptables -A OUTPUT -o $EXTERNAL_INTERFACE -p TCP -m state --state
NEW,ESTABLISHED \
--sport $UNPRIVPORTS --dport 21 -s $EXTERNAL_IP -d $ANYWHERE -j ACCEPT
# Normal Port mode FTP data channels
iptables -A INPUT -i $EXTERNAL_INTERFACE -p TCP -m state --state
ESTABLISHED,RELATED \
--sport 20 --dport $UNPRIVPORTS -s $ANYWHERE -d $EXTERNAL_IP -j ACCEPT
iptables -A OUTPUT -o $EXTERNAL_INTERFACE -p TCP -m state --state
NEW,ESTABLISHED \
--sport $UNPRIVPORTS --dport 20 -s $EXTERNAL_IP -d $ANYWHERE -j ACCEPT
# Passive mode FTP data channels
iptables -A INPUT -i $EXTERNAL_INTERFACE -p TCP -m state --state
ESTABLISHED,RELATED \
--sport $UNPRIVPORTS --dport $UNPRIVPORTS -s $ANYWHERE -d $EXTERNAL_IP -j
ACCEPT
iptables -A OUTPUT -o $EXTERNAL_INTERFACE -p TCP -m state --state
NEW,ESTABLISHED \
--sport $UNPRIVPORTS --dport $UNPRIVPORTS -s $EXTERNAL_IP -d $ANYWHERE -j
ACCEPT
# Because of MASQ
iptables -A FORWARD -p TCP -s $INTERNAL_NETWORK --sport
$UNPRIVPORTS --dport 20:21 -j ACCEPT
iptables -A FORWARD -p TCP -d $INTERNAL_NETWORK --sport
20:21 --dport $UNPRIVPORTS -j ACCEPT
iptables -A FORWARD -p TCP -s $INTERNAL_NETWORK --sport
$UNPRIVPORTS --dport $UNPRIVPORTS -j ACCEPT
iptables -A FORWARD -p TCP -d $INTERNAL_NETWORK --sport
$UNPRIVPORTS --dport $UNPRIVPORTS -j ACCEPT
- Next message: Pascal Nobus: "SPS VPN IPsec"
- Previous message: Rich Piotrowski: "Re: changing the order of NICs"
- Next in thread: ryan: "Re: FTP problem with IPTABLES"
- Reply: ryan: "Re: FTP problem with IPTABLES"
- Reply: Robert Jirik: "Re: FTP problem with IPTABLES"
- Reply: Karl Bickmore: "Re: FTP problem with IPTABLES"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|