Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: "Intercom@x" <intercomax@yahoo.com.br>,
	Netfilter <netfilter@lists.netfilter.org>
Subject: Re: "connection tracking" and "Connection state"?
Date: Wed, 2 Apr 2003 16:04:16 -0500	[thread overview]
Message-ID: <200304021604.16256.netfilter@newkirk.us> (raw)
In-Reply-To: <00d301c2f92d$2e7b9210$2700a8c0@video>

On Wednesday 02 April 2003 10:33 am, intercomax@yahoo.com.br wrote:
> Hi all,
>
> Is it possible to redirect any url request to another address, from an
> internal nat address requesting a valid url to a internal specific
> address? Something like  iptables -t nat -A PREROUTING -p tcp -d
> 192.168.0.0/255.255.0.0 --dport 80 -j DNAT --to-destination
> 192.168.5.254:80 ?

Yes.  However with your scenario above, if the client making the request 
is in 192.168.0.0/16 then it will connect directly to the host, not 
through the firewall.  If the destinations being redirected are public 
IPs with a local client, and the DNAT target is also local, then it is 
also necessary to add:
iptables -t nat -A POSTROUTING -p tcp --dport 80 -d 192.168.5.254 -j SNAT 
--to {FirewallLocalIP}
So that replies will be sent to the firewall to be unDNATted (and now 
unSNATted) to show the IP the client expects a reply from.

j



      reply	other threads:[~2003-04-02 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-02  1:18 "connection tracking" and "Connection state"? SB CH
2003-04-02  3:37 ` Joel Newkirk
2003-04-02 15:33 ` Intercom@x
2003-04-02 21:04   ` Joel Newkirk [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=200304021604.16256.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=intercomax@yahoo.com.br \
    --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