LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 03-10-2004, 02:08 PM   #1
bacon22
Member
 
Registered: Jan 2004
Location: prague
Posts: 31

Rep: Reputation: 15
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
 
Old 03-10-2004, 05:21 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help:iptables redirection swmok Linux - Networking 2 11-24-2004 07:47 AM
IPtables Redirection Exception? BoarderX Linux - Networking 7 09-22-2004 06:43 PM
FTP Proxy with user redirection? Firejack Linux - Networking 0 11-30-2003 07:51 AM
Iptables, Port redirection... and I'm a nimrod finegan Linux - Networking 3 09-14-2003 01:48 PM
ftp and ftp port forwarding with IPtables?? FunkFlex Linux - Security 3 04-24-2002 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration