Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Taylor, Grant" <gtaylor@riverviewtech.net>
To: Alejandro Villarroel <alejandro.villarroel@usm.cl>
Cc: netfilter@lists.netfilter.org
Subject: Re: Local Port Forwarding.
Date: Fri, 22 Apr 2005 16:59:58 -0500	[thread overview]
Message-ID: <426973DE.401@riverviewtech.net> (raw)
In-Reply-To: <1114206098.6690.5.camel@cautin2.dcsc.utfsm.cl>

> Hello:
> 	I'm kind of new to IpTables, and I'm having problems to do this kind of
> port forwarding in my Fedora Core 3:
> 
> Suppose I have some user trying to access Host X:Port X on the Internet
> from my Linux, but Instead of that I want to forward this traffic to the
> localhost:Port Y, what rule I have to apply?
> 
> Thanks in advance,
> 	Alejandro

Alejandro, are you wanting to redirect the traffic of someone (or something / some daemon) running locally on the box that will be doing the redirection?  Or are you wanting to redirect the traffic from an internet connected client to a different system?  From what I read of your question the situation is the former.  As such I'm going to answer that question.

iptables -t nat -A OUTPUT -d $HostX -p tcp --dport $PortX -j REDIRECT --to-ports $PortY



Grant. . . .


      parent reply	other threads:[~2005-04-22 21:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-22 21:41 Local Port Forwarding Alejandro Villarroel
2005-04-22 21:57 ` Jason Opperisano
2005-04-22 22:02   ` Taylor, Grant
2005-04-22 22:07     ` Jason Opperisano
2005-04-27 20:48       ` Nick Drage
2005-04-27 21:00         ` Jason Opperisano
2005-04-26 12:59     ` Alejandro Villarroel
2005-04-22 21:59 ` Taylor, Grant [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=426973DE.401@riverviewtech.net \
    --to=gtaylor@riverviewtech.net \
    --cc=alejandro.villarroel@usm.cl \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox