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