yota + ufanet (local)

Автор Сообщение
УчПочмак ®

Стаж: 15 лет
Сообщений: 97

Создавать темы УчПочмак ® написал(а)
11-Сен-2009 21:35
Создаю темку, ибо нужен роутинг. Причем роутинг как для с ВПН, так и без.
Йота + локал_без_ВПН без роутинга просто так не пашет, ипы уфанета пересекаются с йотовскими.
ОС Windows 7.

Заранее спасибо.
Профиль  ЛС 
_NikOn_

Стаж: 15 лет
Сообщений: 3
Откуда: Russia

Создавать темы _NikOn_ написал(а)
11-Сен-2009 22:30 (спустя 54 минуты)
У тебя какая винда стоит? Извеняюсь, чет я не заметил ag ))) у меня тоже Винда 7, и тоже нужен на неё роутер


Последний раз редактировалось: _NikOn_ (2009-09-11 22:58), всего редактировалось 1 раз
Профиль  ЛС 
Джигмэн

Стаж: 15 лет
Сообщений: 42

Создавать темы Джигмэн написал(а)
11-Сен-2009 22:35 (спустя 5 минут)

_NikOn_ писал(а):

У тебя какая винда стоит?

CblP писал(а):

ОС Windows 7.
aa незадачливый помощник
Профиль  ЛС 
_NikOn_

Стаж: 15 лет
Сообщений: 3
Откуда: Russia

Создавать темы _NikOn_ написал(а)
11-Сен-2009 23:03 (спустя 27 минут)
ну, я такую тему тоже писал... Есть некоторые которые зделали, но у них похоже ХРюша... На ХР должен подходить этот, фактически, это обычный роутер для локала(ВПН) и безлимита, только надо вписать ИП-адрес йоты сюда: gw_ip = "", но не проверял, чисто моё предположеине:

Код:

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 = "" ' <--  IP шлюза писать сюда, между ковычек

'------------------------------------------------------'

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 = "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 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 10.193.1.13 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
  'MsgBox "Выполнено."
end if
но на севене он не работает, поэтому я его немного переделал

Код:

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 = "" ' <--  IP шлюза писать сюда, между ковычек

'------------------------------------------------------'

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.1" 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 = "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 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 10.193.1.13 mask 255.255.255.255 " & global_ip & " metric 1", 0, true
  'MsgBox "Выполнено."
end if
На Windows Vista (Певый код), и Windows 7 (второй код) сначала запускать Локал потом Анлим
Отключить UAC и Брендмауэр
После первого запуска, если попросят, перезагрузиться
Именно в таком порядке! - для одновременной работы локала и анлима уфанета одновременно

Для работы через дополнительный шлюз (ADSL модем, например)(Я думаю что и йоту тоже можно к ним отнести)
Прописать его IP ниже между ковычек gw_ip
Затем запустить соединение уфанета с @local
Затем запустить скрипт

Но на 7 винде чет не работает...
Профиль  ЛС 
УчПочмак ®

Стаж: 15 лет
Сообщений: 97

Создавать темы УчПочмак ® написал(а)
12-Сен-2009 12:34 (спустя 13 часов)
Пробывал тот скрипт, который для XP, на 7 не работает.
Профиль  ЛС 
_NikOn_

Стаж: 15 лет
Сообщений: 3
Откуда: Russia

Создавать темы _NikOn_ написал(а)
12-Сен-2009 19:23 (спустя 6 часов)
На ХР работает... только что установил и попробывал))) в первом коде роутера ввел между ковычек gw_ip IP-адрес Yota... Все работает))) но только на xp(((( А теперь все мозги УфаНета!!!! Обьединяйтесь... Помогите сделать скрипт на Windows 7!!!!!! Он очнь нужен!!!
Профиль  ЛС 
УчПочмак ®

Стаж: 15 лет
Сообщений: 97

Создавать темы УчПочмак ® написал(а)
12-Сен-2009 23:34 (спустя 4 часа)
_NikOn_
Нужен :)
Сам не могу, т.к. не особо в этом шпарю.
Профиль  ЛС 
УчПочмак ®

Стаж: 15 лет
Сообщений: 97

Создавать темы УчПочмак ® написал(а)
14-Сен-2009 18:44 (спустя 1 день 19 часов)
попробовал сделать, но чушь какая-то получилась.
АПъ
Профиль  ЛС 
onoprienko

Стаж: 14 лет
Сообщений: 1
Откуда: Уфа

Создавать темы onoprienko написал(а)
14-Сен-2009 19:53 (спустя 1 час 9 минут)
а что за сервис такой http://www.yota.ru/ ???? ибо он на внешки.
Профиль  ЛС 
Valar

Стаж: 15 лет
Сообщений: 158
Откуда: Уфа

Создавать темы Valar написал(а)
14-Сен-2009 20:23 (спустя 30 минут)
onoprienko
О_о всмысле? Это сайт йоты...
Профиль  ЛС 
Tourism

Стаж: 15 лет
Сообщений: 2
Откуда: Уфа

Создавать темы Tourism написал(а)
14-Сен-2009 20:39 (спустя 15 минут)
что это такое? что там такое?
Профиль  ЛС 
Создавать темы 19-Сен-2009 23:31 (спустя 5 дней)
Топик был перенесен из форума Общение в форум Печь

RbICbKA
 
Показать сообщения:     

Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Вы не можете прикреплять файлы к сообщениям
Вы не можете скачивать файлы

Текущее время: 14-Июн 20:51
Часовой пояс: UTC + 5