I use the /etc/ppp-up option to do this. I found it in the man page for pppd. This script is called with a bunch of parameters including both IP addreses so you cand do prettymuch anything with it.