| 
		      
		        | 
		          
		            |  | Код |  |  |  |  |  
		      
		        |  |  |  |  
		        |  | Option Explicit 
 Dim shl, exec, tmp1, tmp2, tmp3, tmp4, OSVer, mess
 Dim fsob, fl, shl2, exec2, drob1, TmpDir, gw_is_local, gw_is_global
 Dim local_ip, global_ip, gw_ip
 Dim sw, ex, i, n, m, s
 Dim ip(20), st(20)
 
 Set drob1 = CreateObject("WScript.Shell")
 TmpDir = drob1.ExpandEnvironmentStrings("%temp%")
 
 local_ip = ""
 global_ip = ""
 
 
 '------------------------------------------------------'
 
 gw_ip = "CENSORED
  " 
 '------------------------------------------------------'
 
 mess = ""
 tmp1 = ""
 tmp2 = ""
 tmp3 = ""
 tmp4 = ""
 gw_is_local = false
 gw_is_global = false
 ex = ""
 i=0
 n=0
 m=0
 s=0
 sw=false
 
 Set shl = CreateObject("WScript.Shell")
 
 if left(shl.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion"), 1) = "6" then
 
 ex = shl.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRouter")
 
 if ex <> 1 then
 shl.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRouter", 1, "REG_DWORD"
 MsgBox "Необходима перезагрузка.", vbInformation
 sw = true
 end if
 
 end if
 
 if not sw then
 
 Set shl = nothing
 Set exec = nothing
 
 Set shl = CreateObject("WScript.Shell")
 Set exec = shl.Exec("ipconfig.exe")
 
 Do While Not exec.StdOut.AtEndOfStream
 tmp2 = tmp1
 tmp1 = exec.StdOut.Read(1)
 
 if (isnumeric(tmp1) and isnumeric(tmp2)) or (tmp1 = "." and isnumeric(tmp2)) then i=1
 if i=1 and tmp2=chr(13) then
 i=0
 if len(tmp3) > 6 and len(tmp3) < 16 then
 ip(n) = tmp3
 n=n+1
 end if
 tmp3 = ""
 end if
 if i=1 then tmp3 = tmp3 & tmp2
 Loop
 
 tmp1 = ""
 tmp2 = ""
 tmp3 = ""
 tmp4 = ""
 
 Set shl = nothing
 Set exec = nothing
 
 for m=0 to n-1
 'msgbox ip(m)
 tmp4 = left(ip(m),6)
 if tmp4 = "77.79." or tmp4 = "92.50." or tmp4 = "95.105" or tmp4 = "81.30." or tmp4 = "89.189" or tmp4 = "94.41." or tmp4 = "79.140" or tmp4 = "212.46" or tmp4 = "95.30." then global_ip = ip(m)
 if tmp4 = "172.27" then local_ip = ip(m)
 if tmp4 = "172.25" then s = s + 1
 next
 
 if (s = 2) then mess = "Недостаточно денег на счете. И срок действия безлимита истек." & chr(13): sw = true
 if (s = 1) and (local_ip <> "")  and not sw then mess = "Период действия безлимитного доступа истек." & chr(13): sw = true
 if (s = 1) and (global_ip <> "")  and not sw then mess = "Недостаточно денег на счете." & chr(13): sw = true
 if (local_ip = "")  and (global_ip <> "")  and not sw then mess = "Найдено только одно VPN подключение." & chr(13) & "Установите подключение с @local." & chr(13): sw = true
 if (local_ip <> "")  and (global_ip = "")  and not sw then mess = "Найдено только одно VPN подключение." & chr(13) & "Установите подключение по безлимитному договору." & chr(13): sw = true
 if (local_ip = "")  and (global_ip = "")  and not sw then mess = "Установите два VPN подключения одновременно." & chr(13) & "(@local и анлим)" & chr(13): sw = true
 
 if (local_ip <> "")  and (global_ip <> "")  then sw = false: mess = ""
 
 if (local_ip <> "") and (gw_ip <> "") then
 sw = false
 mess = ""
 gw_is_global = true
 end if
 if (global_ip <> "") and (gw_ip <> "")       then
 sw = false
 mess = ""
 gw_is_local = true
 end if
 if gw_is_local then local_ip = gw_ip
 if gw_is_global then global_ip = gw_ip
 if mess <> "" then msgbox mess, vbInformation
 
 end if
 
 if not sw then
 'msgbox "Ваш внешний IP: " & global_ip & chr(13) & "Ваш локальный IP: " & local_ip
 Set exec = CreateObject("WScript.Shell")
 exec.Run "route delete 0.0.0.0", 0, true
 exec.Run "route add 0.0.0.0 mask 0.0.0.0 " & global_ip & " metric 3", 0, true
 exec.Run "route add 172.16.0.0 mask 255.240.0.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 172.25.0.0 mask 255.255.0.0 " & local_ip & " metric 2", 0, true
 if not gw_is_global and left(global_ip, 2) <>  "95" then
 exec.Run "route add 10.0.0.0 mask 255.0.0.0 " & local_ip & " metric 2", 1, true
 end if
 exec.Run "route add 81.30.176.0 mask 255.255.240.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 81.30.192.0 mask 255.255.224.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 89.189.128.0 mask 255.255.224.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 77.79.128.0 mask 255.255.192.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 79.140.16.0 mask 255.255.240.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 92.50.128.0 mask 255.255.192.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 92.50.168.0 mask 255.255.248.0 " & local_ip & " metric 2", 0, true
 exec.Run "route add 95.105.0.0 mask 255.255.128.0 " & local_ip & " metric 1", 0, true
 exec.Run "route add 193.84.31.0 mask 255.255.255.224 " & local_ip & " metric 1", 0, true
 exec.Run "route add 194.0.68.0 mask 255.255.252.0 " & local_ip & " metric 1", 0, true
 exec.Run "route add 94.41.0.0 mask 255.255.0.0 " & local_ip & " metric 1", 0, true
 exec.Run "route add 10.0.5.22 mask 255.255.255.255 " & local_ip & " metric 1", 0, true
 exec.Run "route add 10.160.0.0 mask 255.224.0.0 " & local_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.50 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.69 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.70 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.197.10 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.84 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.5 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.94 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.213.51 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 81.30.199.238 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 exec.Run "route add 10.193.1.13 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
 'MsgBox "Выполнено."
 end if
 |  |  
		        |  |  |  |  |