The code:
Code: Select all
@rasdial VPN username password
@setlocal
@for /f "tokens=1-2 delims=:" %%i in ('ipconfig ^| find "IP Address" ^| find "172.23"') do set GETIP=%%j
@route add 172.30.255.0 mask 255.255.255.0 %GetIp%
@endlocal
Host: 172.30.255.22
Gateway: might be any IP in this range 172.23.241.2-172.23.241.2 given by the DHCP server
That's why I need to know IP of the gateway before adding a route, in Windows 7 is much more simple to do it, but XP gives me headaches!
Thank you.