Its is easier to do with openswan, take a look at http://www.linuxhomenetworking.com/w...ing_Linux_VPNs
as for starting the connection when ppp0 is up, you can create /etc/ppp/ip-up.local and add your commands there something like
if [ "$IFNAME" = "ppp0" ]; then
service ipsec start
And stop if if ppp0 drops, you add that to the ip-down.local file.