From: Grant Taylor <gtaylor@riverviewtech.net>
To: Mail List - Netfilter <netfilter@vger.kernel.org>
Subject: Re: Forwarding traffic from public IP to public IP.
Date: Wed, 28 Nov 2007 13:17:04 -0600 [thread overview]
Message-ID: <474DBEB0.8050501@riverviewtech.net> (raw)
In-Reply-To: <AFB1C16E164D73439741623EBFEA771C4DB07D@lex-exch1.lexionmedical.com>
On 11/28/07 11:45, Jason Hawthorne wrote:
> So would the rules look like this than? Because it doesn't seem to be
> working.
>
> iptables -t nat -A POSTROUTING -d DESTINATION-IP -j SNAT --to-source
> DEBIAN-IP
> iptables -t nat -A PREROUTING -d DEBIAN-IP -j DNAT --to-destination
> SOURCE-IP
No, you do not want to DNAT to SOURCE-IP. You want to do something like
the following:
On DEBIAN, you would want to do something like the following:
# Redirect traffic originally to DEBIAN to be to DESTINATION
iptables -t nat -A PREROUTING -d DEBIAN-IP -j DNAT --to-destination
DESTINATION-IP
# SNAT DNATed traffic from DEBIAN to DESTINATION to be from DEBIAN
iptables -t nat -A POSTROUTING -d DESTINATION-IP -j SNAT --to-source
DEBIAN-IP
SOURCE ---> DEBIAN ---> DESTINATION ---> DEBIAN ---> SOURCE
Grant. . . .
next prev parent reply other threads:[~2007-11-28 19:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-28 16:09 Forwarding traffic from public IP to public IP Jason Hawthorne
2007-11-28 16:38 ` Grant Taylor
2007-11-28 17:45 ` Jason Hawthorne
2007-11-28 17:56 ` Blocking web-based proxy traffic James Lay
2007-11-28 19:20 ` Grant Taylor
2007-11-28 20:01 ` James Lay
2007-11-28 20:07 ` Grant Taylor
2007-11-28 20:16 ` James Lay
2007-11-28 20:35 ` Grant Taylor
2007-11-29 10:55 ` Benny Amorsen
2007-11-29 14:24 ` James Lay
2007-11-29 19:21 ` Grant Taylor
2007-11-28 21:41 ` Tagg McDonald
2007-11-29 1:53 ` dhottinger
2007-11-28 19:17 ` Grant Taylor [this message]
2007-11-28 20:11 ` Forwarding traffic from public IP to public IP Jason Hawthorne
2007-11-28 20:42 ` Grant Taylor
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=474DBEB0.8050501@riverviewtech.net \
--to=gtaylor@riverviewtech.net \
--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