All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ricardo J. Méndez" <mendezster@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Re: IP forwarding
Date: Thu, 4 Aug 2005 12:42:32 -0600	[thread overview]
Message-ID: <286cf082050804114220fcca1f@mail.gmail.com> (raw)
In-Reply-To: <5d2f3791050803220225ab8670@mail.gmail.com>

> > The roule should look like this:
> >
> > iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp --dport 80 -j DNAT
> > --to-destination 192.168.1.202
> 
> Actually, I believe that --to is a valid unique prefix for
> --to-destination.  The fact that it didn't flag as a syntax error
> supports this.

Agreed.  Webmin's IPTables interface displays the rule properly as
well, so --to is a valid substitute.

> The problem is that locally generated packets (from the firewall
> itself) to 1.2.3.4 never pass through filter.PREROUTING.  

But I 'm testing this from a desktop on the network, not the firewall
itself. PREROUTING should apply to those packets, correct?


> Each
> forwarded port may need up to four rules to NAT all access.  The
> script I use (at http://www.curby.net/doc/curbywall ) is an example of
> using all four, though it may be difficult to understand.  

From what I can see from the script, besides creating 1 PRE DNAT and
up to 2 POST SNAT rules (one for the internal network and one for the
de-militarized zone),  cw_forwardin is creating also an OUT rule for
the destination IP.    It also seems that the SNAT rule for the
internal network is using the ip address for the iptables machine as
the source.

Assuming that last one is correct, would that still be the IP address
used for SNAT on the scenario I'm faced with?  IE, doing DNAT/SNAT for
a machine internal to the network, redirecting to it the requests that
come from our network to a web server outside of it.

(Am I missing something?  It's a bit difficult to read, now having
that much experience with bash scripts)


> 
> Other folks here are proponents of running a local DNS server so you
> don't have to do such NAT contortions.

Indeed, it's an approach we considered, but we need this to work with
some internal apps that access the IP address directly.

Thanks,



Ricardo J. Méndez
http://ricardo.strangevistas.net/


  reply	other threads:[~2005-08-04 18:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-04  1:37 IP forwarding Ricardo J. Méndez
2005-08-04  4:15 ` Gömöri Zoltán
2005-08-04  5:02   ` curby .
2005-08-04 18:42     ` Ricardo J. Méndez [this message]
2005-08-04 21:33       ` curby .
2005-08-04 22:20         ` Ricardo J. Méndez
2005-08-04  7:55   ` Jan Engelhardt
2005-08-04 16:22 ` Patrick Nelson
2005-08-04 18:19   ` Ricardo J. Méndez
2005-08-04 19:54     ` Patrick Nelson
2005-08-04 19:33 ` Jason Opperisano
  -- strict thread matches above, loose matches on Subject: below --
2012-01-27  9:59 Prashant Batra (prbatra)
2005-10-21 21:22 IP Forwarding Jerry Alexander
2005-10-22 12:53 ` Henrik Nordstrom
2005-10-22 13:11 ` Aseem Rastogi
     [not found] <20041028172521.3B3CB672@mail.817west.com>
2004-10-28 18:26 ` Ip Forwarding Jason Opperisano
2004-10-30 10:55   ` Nick Drage
2004-10-30 15:25     ` Jason Opperisano
2004-10-30 17:29       ` Nick Drage
2004-10-28 17:23 Joe Wright
2003-02-21 23:46 William Olbrys
2003-02-22  0:28 ` Willi Dyck
2003-02-22  0:47   ` William Olbrys
2003-02-22 14:57     ` William Olbrys
2003-02-23  3:43       ` Bjorn Ruberg
2003-02-23 21:38         ` Willi Dyck
2002-09-28  4:22 IP forwarding SB CH
2002-09-28  7:27 ` Antony Stone

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=286cf082050804114220fcca1f@mail.gmail.com \
    --to=mendezster@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.