Re: Local Port Forwarding.

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

 



On Fri, Apr 22, 2005 at 05:41:38PM -0400, Alejandro Villarroel wrote:
> Hello:
> 	I'm kind of new to IpTables, and I'm having problems to do this kind of
> port forwarding in my Fedora Core 3:
> 
> Suppose I have some user trying to access Host X:Port X on the Internet
> from my Linux, but Instead of that I want to forward this traffic to the
> localhost:Port Y, what rule I have to apply?

your kernel needs to be compiled with the option to nat local
connections:

  CONFIG_IP_NF_NAT_LOCAL=y

(i *believe* that FC3 includes this in their kernel--don't quote me on
that)

with that, you can DNAT local connections in the nat table, OUTPUT
chain:

  iptables -t nat -A OUTPUT -p tcp -d $HostX --dport $PortY \
    -j DNAT --to-destination $LocalHost:$PortY

HTH...

-j

--
"Diane: Tom, you're so deep in the closet you're finding Christmas
 presents."
        --Family Guy



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux