Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-05-2010, 06:57 AM   #1
LQ Newbie
Registered: Jan 2010
Posts: 9

Rep: Reputation: 0
Port forwarding with iptables

Say I have two IPs on the server as follows: and is listening on port 21 (FTP Daemon) is listening on 55555 (Another FTP Daemon)

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

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


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

All times are GMT -5. The time now is 01:46 AM.

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