From: alexb@spsul.com.br
To: Henry Ritzlmayr <h.ritzlmayr@gmx.at>
Cc: Netfilter Mailing List <netfilter@lists.netfilter.org>
Subject: RE: Masquerading on local ports
Date: Thu, 20 Mar 2003 15:34:23 -0300 (BRT) [thread overview]
Message-ID: <1048185263.3e7a09af5b967@www.spsul.com.br> (raw)
In-Reply-To: <1048177609.1493.127.camel@localhost.localdomain>
This one works for me:
iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 81 \
-j REDIRECT --to-ports 80
Alex
Cópia Henry Ritzlmayr <h.ritzlmayr@gmx.at>:
> Am Don, 2003-03-20 um 16.29 schrieb Rob Sterenborg:
> > > 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
> >
> > iptables -t nat -A PREROUTING -d 127.0.0.1 -p tcp --dport 80 -j
> REDIRECT
> > --to-ports 81
> >
> >
> > Rob
>
> Tanks for the answer,
> I tried that one already but it behaves the same.
> I also tried
>
> IPTABLES -t nat -A PREROUTING -p tcp -d 172.16.172.12
> --destination-port
> 81 -j REDIRECT --to-ports 80
>
> wich works perfect for both port 80 and 81 from a foreign host.
>
> Henry
>
>
next prev parent reply other threads:[~2003-03-20 18:34 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 [this message]
2003-03-21 7:22 ` Joel Newkirk
2003-03-21 17:17 ` Henry Ritzlmayr
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=1048185263.3e7a09af5b967@www.spsul.com.br \
--to=alexb@spsul.com.br \
--cc=h.ritzlmayr@gmx.at \
--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