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 - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-09-2004, 09:27 AM   #1
OpsVentus
LQ Newbie
 
Registered: Jan 2004
Location: Nijmegen, the Netherlands
Posts: 17

Rep: Reputation: 0
iptables portforwrding


I know this has been asked and asked again but it dosn't work.

I want to forward ports to my network and been trying this:
iptables -t nat -A PREROUTING -p tcp -i eth1 -d 62.195.129.15 --dport 21 -j DNAT --to 192.168.7.6:21

iptables -A FORWARD -i eth1 -p tcp --dport ftp -d 192.168.7.6 -j ACCEPT

eth1 is my internet connection 62.195.129.15 is my internet-ip 192.168.7.6 is my ip-adres of a computer on the network.
And I want to run a ftp-server from there.

Can anyone find the problem?
 
Old 05-09-2004, 11:27 AM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
Your rules are ok for incoming traffic. But you need a POSTROUTING & FORWARD rules for the packets from the ftp server.
 
Old 05-10-2004, 02:31 AM   #3
OpsVentus
LQ Newbie
 
Registered: Jan 2004
Location: Nijmegen, the Netherlands
Posts: 17

Original Poster
Rep: Reputation: 0
And how do I do that?
Do I have to do that on the computer with the ftp-server?

In my log from the ftp-server(leechftp) I see connected/disconnected message when I connect.

is this it?
iptables -t nat -A POSTROUTING -d 192.168.7.6 -p tcp --dport 21 -j SNAT --to 192.168.7.1

Last edited by OpsVentus; 05-10-2004 at 02:37 AM.
 
Old 05-10-2004, 03:29 AM   #4
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
iptables -t nat -A POSTROUTING -s 192.168.7.6 -p tcp --sport 21 -j SNAT --to 62.195.129.15
if doesnt work, remove "-p tcp --sport 21" and try again.
also do:
modprobe ip_conntrack_ftp
 
Old 05-10-2004, 03:32 AM   #5
OpsVentus
LQ Newbie
 
Registered: Jan 2004
Location: Nijmegen, the Netherlands
Posts: 17

Original Poster
Rep: Reputation: 0
Ok thanks I'll try that.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
An error occured getting IPtables status from the command /etc/rc.d/init.d/iptables s CrazyMAzeY Linux - Newbie 10 08-12-2010 05:25 AM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 02:24 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
iptables book wich one can you pll recomment to be an iptables expert? linuxownt Linux - General 2 06-26-2003 04:38 PM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:58 PM.

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