LinuxQuestions.org
Review your favorite Linux distribution.
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: 96
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


All times are GMT -5. The time now is 11:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration