D-Link Forums

The Graveyard - Products No Longer Supported => D-Link NetDefend Firewalls => Topic started by: eltoncarvalho on October 31, 2011, 06:22:48 PM

Title: pptp vpn client-to-server and static routes
Post by: eltoncarvalho on October 31, 2011, 06:22:48 PM
Hello,

I'm configuring a pptp vpn server and would like to use a ip pool with a network address different of my LAN. It works without problems if I set the "Use default gateway on remote network" option in the Windows vpn connection properties or if I add the route to the LAN using the command line but I can't find any option to do it automatically. I know that Windows RAS has a option to add static routes to the vpn client, but I can't find any configuration like this in the Netdefend 1660 web console or CLI.
Is there any way to do that?

Thank-you
Best Regards,
Elton
Title: Re: pptp vpn client-to-server and static routes
Post by: danilovav on October 31, 2011, 11:14:03 PM
DFL can't push routes into client

Basically, you can use pool from lannet - Windows clients will add route for lannet

To get advanced routing, use connection script like below
In this example, 222 is remote net (need to add into client) and 223 is pptp net

Code: [Select]
@echo off
title PPP VPN caller and routing script

set VPN=RRAS_Name
set VPN_USER=user
set VPN_PASS=pass

echo Calling %VPN%...
rasdial %VPN% %VPN_USER% %VPN_PASS%

echo Removing old routing...
route delete 192.168.222.0

echo Applying routing...
ipconfig > temp1.txt
findstr "192.168.223." temp1.txt > temp2.txt
for /F "tokens=2 delims=:" %%f in (temp2.txt) do echo VPN client address %%f
for /F "tokens=2 delims=:" %%f in (temp2.txt) do route add 192.168.222.0 mask 255.255.255.0 %%f

if exist temp1.txt del temp1.txt
if exist temp2.txt del temp2.txt

echo Done
pause
Title: Re: pptp vpn client-to-server and static routes
Post by: eltoncarvalho on November 14, 2011, 07:11:42 AM
Thank-you for the script.....