[CentOS] A little iptables help

Wed Sep 28 18:09:42 UTC 2005
James Pifer <jep at obrien-pifer.com>

On Wed, 2005-09-28 at 10:46 -0700, Kirk Bocek wrote:
> This need to happen in the nat table:
> 
> iptables -t nat -A PREROUTING -p tcp -d 10.10.60.3 --dport 5900 -j DNAT 
> --to-destination 10.10.60.4:5900
> 
> Make sure 10.10.60.4 is using 10.10.60.3 as it's router for this traffic.
> 
> Kirk

I can't make 10.10.60.3 use 10.10.60.4 as the router. 

If I loaded a port forwarding application on 10.10.60.3 and had it
forward ports to .4 for port 5900 I would not have this requirement. 

Can't iptables to the same thing somehow?

I have a java application that would do the port forwarding I need,
EXCEPT, that application will not let me restrict by ip address. BUT,
now that I think about it, I could run this java application to forward
the ports and just use iptables to make that port only available to
certain IPs. It would be accomplishing the same thing I suppose. 

Would still rather do it with iptables since that would be one less
point of failure. 

Thanks,
James