LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-05-2010, 05:57 AM   #1
cigarette
LQ Newbie
 
Registered: Jan 2010
Posts: 9

Rep: Reputation: 0
Port forwarding with iptables


Say I have two IPs on the server as follows:

1.2.3.4 and 5.6.7.8

1.2.3.4 is listening on port 21 (FTP Daemon)

5.6.7.8 is listening on 55555 (Another FTP Daemon)

What iptables rule do I add so that port 21 to 5.6.7.8 is forwarded to port 55555 on 5.6.7.8? It should not affect the other IP.
 
Old 03-05-2010, 10:06 AM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
iptables -A PREROUTING -p tcp -m tcp --dport 21 -d 5.6.7.8 -j DNAT --to-destination 5.6.7.8:55555
 
  


Reply

Tags
ftp, iptables, networking


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
port forwarding with iptables sunlinux Linux - Networking 3 05-10-2008 01:33 AM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Forwarding a port using iptables xtremeclones Linux - Networking 1 11-18-2006 05:21 AM
iptables and port forwarding cs.cracker Linux - Networking 5 09-02-2006 01:03 PM
IPTABLES and port forwarding freibuis Linux - Networking 5 04-21-2004 09:06 PM

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

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