From: David Cannings <lists@edeca.net>
To: netfilter@lists.netfilter.org
Subject: Re: Redirecting ports on localhost
Date: Tue, 30 Mar 2004 20:13:40 +0100 [thread overview]
Message-ID: <200403302013.40298.lists@edeca.net> (raw)
In-Reply-To: <406980E5.6080107@personalsoft.com.br>
On Tuesday 30 March 2004 15:15, Fabiano Bonin wrote:
> > On Tuesday 30 March 2004 13:46, Fabiano Bonin wrote:
> >> iptables -F
> >> iptables -F -t nat
> >> iptables -A OUTPUT -t nat -p tcp -o lo -d 192.168.0.254 --dport 5050
> >> -j REDIRECT --to-ports 5050
> >> echo "1" > /proc/sys/net/ipv4/ip_forward
> > I don't think you need anything special to do this however your rule
> > says "any packets going out on loopback to 192.168.0.254". The only
> > machine on your network that would send packets to 192.168.0.254 on
> > loopback is the machine with that IP itself.
> > Perhaps I misunderstand what you are trying to accomplish, apologies
> > if so.
>
> Most probably you understood what i am trying to do, and the way i'm
> trying (as shown in the examples) is entirelly wrong. I used iptables
> few times before and i'm not skilled with it.
>
> Maybe you can show the command needed to my case (i.e., using DNAT as
> you told above). Sorry if i'm asking too much... I just need the hosts
> on my local network can access this port through server's eth0.
http://netfilter.org/documentation/HOWTO//NAT-HOWTO-6.html#ss6.2
I've linked to the English HTML version of the HOWTO, other languages and
formats are available at:
http://netfilter.org/documentation/index.html#documentation-howto
Have a read, see if you can make some sense of it. If not, post back with
what you've tried and why it doesn't work. For the record, I've never
tried redirecting a port to localhost although I can see no reason why it
would not work as any other does. I will have to give it a go myself
when I have a few minutes spare.
Hope that helps,
David
next prev parent reply other threads:[~2004-03-30 19:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040330133505.22298.90925.Mailman@vishnu.netfilter.org>
2004-03-30 14:15 ` Redirecting ports on localhost Fabiano Bonin
2004-03-30 19:13 ` David Cannings [this message]
2004-03-30 22:03 ` Tony Earnshaw
2004-03-30 22:31 ` David Cannings
2004-03-31 0:40 ` Tony Earnshaw
2004-03-30 22:33 ` David Cannings
2004-03-30 12:46 Fabiano Bonin
2004-03-30 13:00 ` David Cannings
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=200403302013.40298.lists@edeca.net \
--to=lists@edeca.net \
--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