[CentOS] port mapping

Mon Jan 21 03:25:13 UTC 2008
Sobari Tanuwijaya <tanuwijaya at gmail.com>

Thanks for your help.
I will try to do it in the server.
Is there any document that should read about this?

Barry Brimer wrote:
>> Yes.
>>
>> I plan to use centos as the OS on the gateway server.
>>
>>
>> Barry Brimer wrote:
>>> So you're trying to determine what you need to do to forward 
>>> connections from your system to port 5555 on the remote system via 
>>> your gateway it seems.  What is your gateway running?  Is it running 
>>> CentOS?
> 
> I would use something like:
> 
> iptables -t nat -I PREROUTING -d <public ip address of server> -p tcp 
> --dport 5555 -j DNAT --to <private IP address of database server>
> 
> If you are not already masquerading traffic out, this should handle that.
> "iptables -t nat -A POSTROUTING -s <internal network/mask> -j MASQUERADE"
> 
> 
> Once you see that work, you can do a "service iptables save" to save the 
> configuration and "chkconfig iptables on" to make sure it starts on boot.
> 
> Barry