Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Fabiano Bonin <fabiano@personalsoft.com.br>
To: netfilter@lists.netfilter.org
Subject: Redirecting ports on localhost
Date: Tue, 30 Mar 2004 09:46:18 -0300	[thread overview]
Message-ID: <40696C1A.5080400@personalsoft.com.br> (raw)

I followed a thread about redirecting ports on localhost, but i still 
did not have success in my case.
I have a service listening on port 5050, just on the local interface, as 
shown below:

netstat -n -a -p | grep 5050
tcp        0      0 127.0.0.1:5050          0.0.0.0:*               
LISTEN      7485/0

I need to access this service from other hosts through ETH0 interface 
(ip 192.168.0.254). The other hosts are in the same network.
I already enabled "NF_NAT_LOCAL" kernel option (btw, all netfilter 
options are enabled in my kernel), and the commands i'm using are these:

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

After these commands, i can access the service on the eth0 interface 
from the server host itself, but not from other hosts in the same network.

What am i doing wrong?

Thanks.



             reply	other threads:[~2004-03-30 12:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-30 12:46 Fabiano Bonin [this message]
2004-03-30 13:00 ` Redirecting ports on localhost David Cannings
2004-04-01  8:25 ` Redirection to local lan, isn't DNAT method unsafe Bo Jacobsen
2004-04-01  8:37   ` Antony Stone
2004-04-01  8:55     ` Bo Jacobsen
2004-04-01  9:05       ` Antony Stone
2004-04-01  9:42         ` Bo Jacobsen
2004-04-01  9:55           ` Antony Stone
2004-04-01 12:43             ` Bo Jacobsen
2004-04-01 22:20             ` Unknown, Alistair Tonner
     [not found]             ` <200404011720.57604.Alistair Tonner <>
2004-04-01 22:52               ` Antony Stone
2004-04-22  3:49   ` Alexander Samad
     [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
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

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=40696C1A.5080400@personalsoft.com.br \
    --to=fabiano@personalsoft.com.br \
    --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