Firstly i should write out what i understand.. Your machine is gateway of your internal network and you want to route the packets coming from your internal network and going to internet by changing the original source IP address with your machine's IP address. And also doing the reverse when you get a packet coming from internet. Right?
If so, you can use iptables for changing the source address of packets going to internet via one interface of your machine. Read the source NAT documentation at www.netfilter.org
Since you're using ppp interface (dynamic IP), also read the masquerading part. It's easier with masquerading when your IP is not static. Hope this helps.