LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-08-2007, 07:08 PM   #1
ikaro_tatsomura
LQ Newbie
 
Registered: Feb 2007
Posts: 1

Rep: Reputation: 0
Configure iptables to forward ports to an internal server


Hi

I have a Compaq ProLiant server (running Debian 3.1 r2). It's a HTTP and DNS server. The server have 2 NICs:

eth0: 192.168.x.1
eth1: External (and static) IP from my ISP.

Well, I've more servers:
* A FTP server (192.168.x.2)
* A SSH server (192.168.x.3)
* A database server (192.168.x.4)
* A SMTP/POP3 server (192.168.x.5)

At this moment, I need to set the FTP server to public access (like HTTP server) using the same external IP from my ISP.

All server are in different PCs. My question is:

How I can redirect the incoming traffic (FTP request) from Internet to my internal FTP server using Iptables?

I'm using Linux kernel 2.6

Thanks in advance

Miguel
 
Old 02-08-2007, 07:45 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
You will want to use the DNAT option. Example is forward ssh port 22 from eth0 to 192.168.69.69 port 22.

/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 22 -j DNAT --to-destination 192.168.69.69:22

Brian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Forward SMTP to another server (SuSE with iptables) baetmaen Linux - Security 2 02-11-2006 03:05 PM
iptables forwarding to internal server pyloth Linux - Security 4 04-17-2005 01:51 PM
Can't browse internal web server using iptables iel Linux - Networking 7 03-25-2004 01:56 AM
iptables - change port and forward to a internal server leandrok Linux - Networking 0 01-16-2004 10:52 AM
How to forward ports with iptables? Electrode Linux - Networking 3 11-12-2002 01:04 AM

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

All times are GMT -5. The time now is 03:37 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