Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Mart Frauenlob <mart.frauenlob@chello.at>
To: netfilter@vger.kernel.org
Subject: Re: Port forward/bounce no external interface
Date: Fri, 06 Feb 2009 22:15:09 +0100	[thread overview]
Message-ID: <498CA85D.1020609@chello.at> (raw)
In-Reply-To: <498CA7A8.1040103@chello.at>

Mart Frauenlob wrote:
> Don Hoover wrote:
>> I want to forward all connections on a port to another box on the 
>> same internal network.
>>
>> For instance, I want to forward all traffic on my server:5000 to go 
>> anotherbox:9000
>>
>> I have little experience with iptables, and I am currently not using 
>> it at all on this server, so I will need to setup a small iptables 
>> configuration from scratch including any required setup before 
>> whatever command is needed to do this.
>>
>> This will all be in the same network and not actually be going across 
>> interfaces...the client, server, and otherbox are all located on the 
>> same internal network.
>>
>> I am sure this is probably easy for someone what really knows what 
>> they are doing.... AND...I have been reading as much as I can on 
>> this, and all the examples I have found via extensive google 
>> searching all deal with the apparently much more common case of 
>> forwarding incoming connections on a external facing network 
>> interface to a different port for a different IP on an internal 
>> facing interface, ala firewall router.  And that just does not apply 
>> here.  I kinda thought maybe what I wanted was a variation on that 
>> and I tried some different things but none of them worked.
>>
>> Any help?
>>   
> Hello,
>
> Please try:
>
> iptables -t nat -A PREROUTING -s your-network -d server -p tcp --dport 
> -j DNAT --to-destination anotherbox:9000

sorry, I missed the port string.
should be:

iptables -t nat -A PREROUTING -s your-network -d server -p tcp --dport 
5000 -j DNAT --to-destination anotherbox:9000



  reply	other threads:[~2009-02-06 21:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 20:00 Port forward/bounce no external interface Don Hoover
2009-02-06 21:12 ` Mart Frauenlob
2009-02-06 21:15   ` Mart Frauenlob [this message]
2009-02-09 20:00     ` Don Hoover

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=498CA85D.1020609@chello.at \
    --to=mart.frauenlob@chello.at \
    --cc=netfilter@vger.kernel.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