From: "curby ." <curby.public@gmail.com>
To: "Gömöri Zoltán" <suf@freemail.hu>
Cc: netfilter@lists.netfilter.org
Subject: Re: IP forwarding
Date: Wed, 3 Aug 2005 23:02:44 -0600 [thread overview]
Message-ID: <5d2f3791050803220225ab8670@mail.gmail.com> (raw)
In-Reply-To: <200508040415.j744FBjF040033@fenyo.mail.t-online.hu>
On 8/3/05, Gömöri Zoltán <suf@freemail.hu> wrote:
> Hi,
>
> > -----Original Message-----
> > From: netfilter-bounces@lists.netfilter.org
> > [mailto:netfilter-bounces@lists.netfilter.org] On Behalf Of
> > Ricardo J. Méndez
> > Sent: Thursday, August 04, 2005 3:38 AM
> > To: netfilter@lists.netfilter.org
> > Subject: IP forwarding
> >
> > Hi,
> >
> > I've got a network setup where the internal router is a Linux box
> > running iptables. External interface is eth0, internal eth1. I'm
> > attempting to forward an external IP address (say, 1.2.3.4) to an
> > internal machine.
> >
> > The rule I added is:
> >
> > iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp --dport 80 -j DNAT
> > --to 192.168.1.202
>
> 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.
The problem is that locally generated packets (from the firewall
itself) to 1.2.3.4 never pass through filter.PREROUTING. 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. The general
principle but applied to the SNAT-ed network as opposed to localhost
is described in
http://netfilter.org/documentation/HOWTO//NAT-HOWTO-10.html
Other folks here are proponents of running a local DNS server so you
don't have to do such NAT contortions.
--Curby
next prev parent reply other threads:[~2005-08-04 5:02 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 . [this message]
2005-08-04 18:42 ` Ricardo J. Méndez
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=5d2f3791050803220225ab8670@mail.gmail.com \
--to=curby.public@gmail.com \
--cc=netfilter@lists.netfilter.org \
--cc=suf@freemail.hu \
/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.