From: Henry Ritzlmayr <h.ritzlmayr@gmx.at>
To: netfilter@newkirk.us,
Netfilter Mailing List <netfilter@lists.netfilter.org>
Subject: Re: Masquerading on local ports
Date: 21 Mar 2003 18:17:43 +0100 [thread overview]
Message-ID: <1048267063.1493.162.camel@localhost.localdomain> (raw)
In-Reply-To: <200303210222.47189.netfilter@newkirk.us>
Am Fre, 2003-03-21 um 08.22 schrieb Joel Newkirk:
> On Thursday 20 March 2003 09:03 am, Henry Ritzlmayr wrote:
> > Hi everyone - this is my first post to this list - so if anything is
> > wrong with my way of posting please tell.
> >
> > And here is the question. How is it possible to nat a lokal port?
> >
> > IPTABLES -t nat -A PREROUTING -p tcp -d 127.0.0.1 --destination-port
> > 81 -j DNAT --to-destination 127.0.0.1:80
> >
> > telnet localhost 80 <<< works
> > telnet localhost 81 <<< Connection refused
> >
> > Henry
>
> Packets originating on the local box never go through the PREROUTING
> chains. This is why there is an OUTPUT chain in the nat table. (and
> the mangle table)
>
> iptables -t nat -A OUTPUT -o lo -p tcp --dport 81 -j DNAT --to
> 127.0.0.1:80
>
> should do it. I'm not sure if the REDIRECT target would work properly
> for this use (localhost->localhost), but you can try easily enough.
>
> j
That was it. I overlooked that local packets do not go trough the
PREROUTING.
thanks for the help
Henry
prev parent reply other threads:[~2003-03-21 17:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-20 14:03 Masquerading on local ports Henry Ritzlmayr
2003-03-20 15:29 ` Rob Sterenborg
2003-03-20 16:14 ` henry ritzlmayr
2003-03-20 16:26 ` Henry Ritzlmayr
2003-03-20 18:34 ` alexb
2003-03-21 7:22 ` Joel Newkirk
2003-03-21 17:17 ` Henry Ritzlmayr [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=1048267063.1493.162.camel@localhost.localdomain \
--to=h.ritzlmayr@gmx.at \
--cc=netfilter@lists.netfilter.org \
--cc=netfilter@newkirk.us \
/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