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.