Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Mike Wright <ebwximaurm@mailinator.com>
To: netfilter@lists.netfilter.org
Subject: Re: ip redirection
Date: Mon, 27 Mar 2006 08:21:05 -0800	[thread overview]
Message-ID: <442810F1.3020300@mailinator.com> (raw)
In-Reply-To: <52837e3e0603270713g798cea20v1e718747a631a095@mail.gmail.com>

Bruno Nunes wrote:
> this is what the dns server does:
> 
>  intranet.xxxxxxxxx.com.br --> AAA.AAA.AAA.AAA
> 
>  requests to intranet... goes to AAA....A  (the router)
> 
>  this is what i want:
> 
>  AAA.AAA.AAA.AAA (router) --> BBB.BBB.BBB.BBB (webserver)
> 
>  BBB...B is an IP address inside a private network like 192.168.1.x
>  AAA...A is a worldwide ip address like 139.82.x.x
> 
>  How can I do this redirection with iptables?

It's called Network Address Translation.  (man iptables)

iptables -t nat -A PREROUTING -d AAA.AAA.AAA.AAA \
          -p tcp -m tcp --dport 80 \
          -j DNAT --to-destination BBB.BBB.BBB.BBB

> 
>  thanks!
> 
>  bruno
> 
> 
> 


  reply	other threads:[~2006-03-27 16:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-27 15:13 ip redirection Bruno Nunes
2006-03-27 16:21 ` Mike Wright [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-28 12:37 Bruno Nunes
2006-03-28 14:52 ` Rob Sterenborg

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=442810F1.3020300@mailinator.com \
    --to=ebwximaurm@mailinator.com \
    --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