[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IPtables localhost redirect



On Fri, Jul 9, 2010 at 19:09, Toan Pham <tpham3783@gmail.com> wrote:
> Here's the trick,
>
> # Trick the kernel to route localhost ip (127.0.0.1) in prerouting
> rule, and continue routing out through the valid network interface
> (not the loopback interface).
> ifconfig eth0:0 127.0.0.1
>
> # Setup NAT Table to redirect traffic
> iptables -t nat -A PREROUTING -p tcp --dport 5432 -j DNAT --to
> 192.168.1.113:5432
>
>
> I haven't tried it yet, let me know if it works.

Thanks, but it doesn't work.

Someone said me on a forum:
"""
You cannot redirect loopback traffic with iptables.
"""
I'm investigating this statement.

reference:
http://www.linuxquestions.org/questions/showthread.php?p=4027927


Reply to: