Getting routes to be added after VPN connection is established is a bit tricky at least on some DDWRT routers.
In order to add routes after PPTP connection is established you need to modify ip-up script in /tmp/pptpd_client. The problem is that this script is generated when pptpd starts.
To modify it you need to add a startup script that will wait for this file to be created and then append whatever custom routes are needed.
Assuming that PPTP Server has IP 172.16.0.1 and you want to add routes to 172.16.2.0/24 and 172.16.3.0/24 networks, saving this as startup script will do the trick:
while [ ! -f /tmp/pptpd_client/ip-up ] do sleep 1 done cd /tmp/pptpd_client cp ip-up ip-up.old grep -v 'exit 0' ip-up.old > ip-up echo "/sbin/route add -net 172.16.2.0/24 gw 172.16.0.1" >> ip-up echo "/sbin/route add -net 172.16.3.0/24 gw 172.16.0.1" >> ip-up echo "exit 0" >> ip-up
Try to reboot the router, wait for PPTP connection to come up. Check the routing table using ip route command.
Comments
My config is:
My config is:
dd-wrt v24 sp1 pptp server
Local pptp server: 192.168.1.1/24
pptp client receives ip adress 192.168.0.90 (subnet 192.168.0.0/24)
I'm still unable to ping from my server network 192.168.1.1/24 to the client device network 192.168.0.90/24
Am I doing something wrong? I tried the code:
while [ ! -f /tmp/pptpd_client/ip-up ]
do
sleep 5
done
cd /tmp/pptpd_client
cp ip-up ip-up.old
grep -v 'exit 0' ip-up.old > ip-up
echo "/sbin/route add -net 192.168.0.0/24 gw 192.168.1.1" >> ip-up
echo "exit 0" >> ip-up
Since dd-wrt is acting as
Since dd-wrt is acting as server routes are added automatically.
Check with 'route' command from console after a client connects.
Based on what you describe i would look into two things:
Try adding a route for your LAN to your client.
Hello!
Hello!
sh: eval: line 9: syntax error: unexpected end of file (expecting ¹(wsHdouot;ß|)
while [ ! -f /tmp/pptpd_client/ip-up ]
do
sleep 1
done
cd /tmp/pptpd_client
cp ip-up ip-up.old
grep -v 'exit 0' ip-up.old > ip-up
echo "/sbin/route add -net 192.168.5.0/24 gw 192.168.0.1" >> ip-up
echo "exit 0" >> ip-up
Add new comment