Re: Redirecting internal tcp connections

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

 



You have to do this in the nat table and the prerouting or
output chain, and you should use DNAT instead of REDIRECT,
because REDIRECT is for packets with destination your own
machine. So we have:

iptables -t nat -A PREROUTING -p tcp --dport 515 -j DNAT --to-
destination remotehost.com:900

I would suggest that you add a destination match as well so that you don't blindly redirect traffic destend to any system's LPD port. I.e. make your IPTables like look like this:

iptables -t nat -A PREROUTING -p tcp -d remotehost.com --dport 515 -j DNAT --to-destination remotehost.com:900



Grant. . . .


[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