Consider a situation in which you have a Machine (Machine1) which has a Public IP access on it (Let 202.11.11.11) and a Private Machine sub-netted (Machine2, Let 10.0.1.2).Machine2 has web-application and other web-services running on it, but there is no direct Internet access to the Machine2 and the traffic (https requests) needs to be routed through Machine1.I am able to do a Port Forwarding on Machine2 which is going good but I wish to perform the same using NAT or Iptables.Also I need to make sure that the routing does not intervene with the present security as Machine2 will be running application that would be supporting banking transactions. So a request to mention security aspects as well while providing any solution.There are several similar questions on Internet but there is an absence of a clean working solution to it. Moreover, it would be great if someone could point the exact config files that has to be changed to route the traffic other than the linux commands which enable configuration for the same, so as to help understand the background functionality.And of course, any help is greatly appreciated!
Route request on Public IP to an internal Private IP
iptables;routing;nat