Add static routes to incoming VPN connections on PopTop VPN

You may want to add a static route to incoming VPN connections on a PopTop VPN server. This only works when you define a static IP for the incoming VPN client in /etc/ppp/chap-secrets.

Create a file called /etc/ppp/ip-up.local and chmod 700 it.
I also used a sort of log as you can see, you have to create it first (touch /var/log/ppp-ip).
You also might want to create a similar ip-down.local to delete the route.

#!/bin/sh

echo "Connected VPN client ($@)" >> /var/log/ppp-ip

if [ "$5" = "10.0.51.11" ] ; then
/sbin/route add -net 10.10.0.0/16 gw $5
echo "Added route to gw $5 for $6 on $1" >> /var/log/ppp-ip
fi