LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   redirection of ftp using iptables (https://www.linuxquestions.org/questions/linux-general-1/redirection-of-ftp-using-iptables-155952/)

bacon22 03-10-2004 02:08 PM

redirection of ftp using iptables
 
Hallo I want to use ftp server on the local network machine. I've added these lines to my iptables rules:
iptables -t nat -A PREROUTING -p TCP --dport 2121 -i $EXTERNAL_IFC -j DNAT --to 192.168.1.2:21
iptables -A FORWARD -p TCP -d 192.168.1.2 --dport 21 -i $EXTERNAL_IFC -j ACCEPT
iptables -A FORWARD -p TCP -d 192.168.1.2 -i $EXTERNAL_IFC -m state --state ESTABLISHED,RELATED -j ACCEPT

my $EXTERNAL_IFC is connected to internet as you can see. I want to connect from internet to my machine to port 2121 and be redirected to my machine on local network to port 21.
I've added some forwarding rules because the default policies are drop.
but firewalls showing me this when I try to connect from out:
kernel: IN=eth0 OUT=eth1 SRC=XXX.XXX.XXX.XXX DST=192.168.1.2 LEN=48 TOS=0x00 PREC=0x00 TTL=127 ID=6835 DF PROTO=TCP SPT=1450 DPT=21 WINDOW=16384 RES=0x00 SYN URGP=0

Does anybody know which else rules I need to add. Please.
THANX

trickykid 03-10-2004 05:21 PM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php


All times are GMT -5. The time now is 09:13 PM.