Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Старожил


Сообщения: 161
Благодарности: 5

Профиль | Отправить PM | Цитировать


Iska, Вот это то, что нужно, похоже.
Но как туда прикрутить список IP из файла?
Код: Выделить весь код
'  This VBScript file includes sample code that adds a
'  Generic Routing Encapsulation (GRE) protocol rule 
'  using the Microsoft Windows Firewall APIs.


option explicit

Dim CurrentProfiles

'Action
Const NET_FW_ACTION_ALLOW = 1

' Create the FwPolicy2 object.
Dim fwPolicy2
Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2")

' Get the Rules object
Dim RulesObject
Set RulesObject = fwPolicy2.Rules

CurrentProfiles = fwPolicy2.CurrentProfileTypes

'Create a Rule Object.
Dim NewRule
Set NewRule = CreateObject("HNetCfg.FWRule")
    
NewRule.Name = "GRE_RULE"
NewRule.Description = "Allow GRE Traffic"
NewRule.Protocol = 47
NewRule.Enabled = TRUE
NewRule.Grouping = "@firewallapi.dll,-23255"
NewRule.Profiles = CurrentProfiles
NewRule.Action = NET_FW_ACTION_ALLOW
    
'Add a new rule
RulesObject.Add NewRule

Отправлено: 16:44, 15-12-2017 | #8