Код:
@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 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
Комментариев нет:
Отправить комментарий