exactly. id suggest reading this

http://iptables-tutorial.frozentux.net/iptables-tutorial.html

and paying special attention to ip forwarding and SNAT postrouting.