u need to read howto's.. u can find them at www.netfilter.org
i will try to explain basicly..
1 - first u must enable routing. edit /etc/sysctl.conf and change the line like this
net.ipv4.ip_forward = 1
2 - enable SNAT (to allow web server reply tcp packets comes from internet)
iptables -t nat -A POSTROUTING -s web_server_ip -j SNAT --to linux_public_ip
3 - redirect tcp port 80 pakets which comes from internet, to web server.. change eth0 to interface which connected to internet..
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to web_server_ip
u must read howtos to config your linux as a firewall. these commands just redirects tcp 80 port to web server. and allow webserver ro reach internet via NAT.
following line will save iptables configuration..
service iptables save
this line shows the config of iptables
service iptables status