Skip to contentSkip to conversation

masqued AND forwarded

DISCUSSION TestMail 2 participants 2 messages Jan 27, 2005

lore
Share & tools
lore

TestMail

author
#0 lore raw

Try this one :

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp

iptables -t nat -A PREROUTING -i $EXT_IF -p tcp -d $PUBLICIPADD \
--dport 21 -j DNAT --to-destination $LOCALADDOFFTP

iptables -A FORWARD -i $EXT_IF -o $INT_IF -p tcp --syn -d $LOCALADDOFFTP \ --dport 21 -j ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # This is the stateful inspection command.

# It only allows in what you send out first.

Milo

----- Original Message -----
From: "TestMail" <[email protected]>
To: <[email protected]>
Sent: Thursday, January 27, 2005 05:15 PM
Subject: Re: masqued AND forwarded

Quoted 5 lines

Try this one :

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp

Quoted 8 lines
 iptables -t nat -A PREROUTING -i $EXT_IF -p tcp -d $PUBLICIPADD \
   --dport 21 -j DNAT --to-destination $LOCALADDOFFTP

iptables -A FORWARD -i $EXT_IF -o $INT_IF -p tcp --syn -d $LOCALADDOFFTP \ --dport 21 -j ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # This

is

Quoted 4 lines

the stateful inspection command.

# It only allows in what you send out first.

Quoted 29 lines

Milo

----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Thursday, January 27, 2005 06:44 AM
Subject: ftp: masqued AND forwarded

Quoted 20 lines

Hi all,
I have spent several hours scouring the
archives trying to find out how to send external ftp requests to an internal server while at the same time allowing clients behind the firewall to access external ftp servers. (currently requests from internal clients to external ftp servers time out).

Any suggestions would be greatly appreciated!

Here are the rules that I have in place:

#Load Modules
/sbin/modprobe ip_tables
/sbin/modprobe iptable_filter
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp

#Send ftp to an internal machine
$IPTABLES -A PREROUTING -t nat -i $EXTERNALIF -p tcp -d $MYADDR --dport

20

Quoted 4 lines
Quoted 4 lines

-j DNAT --to 192.168.2.5:20
$IPTABLES -A FORWARD -i $EXTERNALIF -p tcp -d 192.168.2.5 --dport 20 -j ACCEPT
$IPTABLES -A PREROUTING -t nat -i $EXTERNALIF -p tcp -d $MYADDR --dport

21

Quoted 8 lines
Quoted 8 lines

-j DNAT --to 192.168.2.5:21
$IPTABLES -A FORWARD -i $EXTERNALIF -p tcp -d 192.168.2.5 --dport 21 -j ACCEPT

#Masquerade internal connections going out. $IPTABLES -A POSTROUTING -t nat -o $EXTERNALIF -j MASQUERADE

Quoted 5 lines
Quoted 5 lines

$MYADDR is the firewall external address
$EXTERNALIF is the external interface (eth0)
$INTERNALIF is the internal interface (eth1)

My apologies if this question has already been answered (probable) and

ask

Quoted 5 lines
Quoted 4 lines

forgiveness for my lack of being able to find it.

Travis Crook
Visions Beyond

#1 lore raw
Quoted 7 lines · TestMail

Try this one :

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp

 iptables -t nat -A PREROUTING -i $EXT_IF -p tcp -d $PUBLICIPADD \
   --dport 21 -j DNAT --to-destination $LOCALADDOFFTP

yes.

Quoted 2 lines

iptables -A FORWARD -i $EXT_IF -o $INT_IF -p tcp --syn -d $LOCALADDOFFTP \ --dport 21 -j ACCEPT

yes.

Quoted 2 lines

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # This is the stateful inspection command.

bzzzzzzzt. how about:

  iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

-j

--
"Well, I'm tired of being a wannabe league bowler. I wanna be a
league bowler!"
--The Simpsons