Guys i am having an issue with NAT on centos. In my LAB Centos is configured as a router. I want to run my local system (example: 192.168.1.45) apache server on live IP (example 112.100.4.34).
This is already done by another user but i am unable to do it.
this can be done via post-routing table and masquerade:
previous rule will nat all traffic trough the eth0 interface and change the source address (if that is the interface with the public ip address.) if you want to nat a single ip:
If you want to persistent the previously rule add the rule removing
iptables
prefix in to/etc/sysconfig/iptables
file of your centos.To have a detail of the iptables rules take a read here