svin0, !mts, вот так у меня получилось. Это верно?
set pause=5
set connected=0
cls
for /f "delims=" %%i in ('rasdial') do (
if "%%i"=="%connection:"=%" set connected=1
)
if %connected%==0 (
echo %date% %time% "%connection%" connection not detected. Dialing...
rasdial "%connection:"=%" %Login% %Password%
) else (
echo %date% %time% "%connection%" connection is active.
)
:end_con
:: Здесь маршруты
@echo off
rem new network
route add -p 86.57.151.0 mask 255.255.255.224 192.168.1.1
rem game servers
route add -p 86.57.251.28 mask 255.255.255.255 192.168.1.1
rem stat.byfly.by
route add -p 86.57.253.1 mask 255.255.255.255 192.168.1.1
rem http://www.byfly.by
route add -p 193.232.248.79 mask 255.255.255.255 192.168.1.1
rem http://www.belpak.by
route add -p 193.232.248.80 mask 255.255.255.255 192.168.1.1
rem jabber
route add -p 82.209.245.151 mask 255.255.255.255 192.168.1.1
rem mogilev
route add -p 194.158.206.240 mask 255.255.255.255 192.168.1.1
route add -p 194.158.206.241 mask 255.255.255.255 192.168.1.1
route add -p 194.158.206.246 mask 255.255.255.255 192.168.1.1
rem grodno
route add -p 194.158.202.59 mask 255.255.255.255 192.168.1.1
rem brest
route add -p 82.209.195.15 mask 255.255.255.255 192.168.1.1
rem dc
route add -p 86.57.250.0 mask 255.255.254.0 192.168.1.1
route add -p 86.57.246.0 mask 255.255.255.0 192.168.1.1
route add -p 93.84.112.0 mask 255.255.248.0 192.168.1.1
rem extmedia at dc
route add -p 91.149.189.0 mask 255.255.255.128 192.168.1.1
route add -p 91.149.189.128 mask 255.255.255.192 192.168.1.1
route add -p 93.125.53.0 mask 255.255.255.0 192.168.1.1
rem [censored] at dc
route add -p 91.149.157.0 mask 255.255.255.128 192.168.1.1
rem dns
route add -p 82.209.240.241 mask 255.255.255.255 192.168.1.1
route add -p 82.209.243.241 mask 255.255.255.255 192.168.1.1
::--------------------------------------------------------------------------------------------------------
::--------------------------------------------------------------------------------------------------------
ipconfig > ip.txt
findstr "IP-" ip.txt > ip2.txt
:: берет IP всех соединений и прописывает в роуты 2-й. Тоесть guest. ТОчно также можно
for /F "skip=1 tokens=2 delims=:" %%f in (ip2.txt) do route add 86.57.151.0 mask 255.255.255.224 %%f
for /F "skip=1 tokens=2 delims=:" %%f in (ip2.txt) do route add 86.57.251.28 mask 255.255.255.255 %%f
:: и так далее
::--------------------------------------------------------------------------------------------------------
::--------------------------------------------------------------------------------------------------------
route change 0.0.0.0 MASK 0.0.0.0 192.168.1.1 METRIC 1
::ping -n %pause% 127.0.0.1>nul 2>&1
ping -n %pause% byfly.by 2>&1