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
|