加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

将Windows网络配置文件从“DomainAuthenticated”更改为Public

发布时间:2021-01-18 08:02:29 所属栏目:Windows 来源:网络整理
导读:我有一个域加入了 Windows Server 2012 R2,其上安装了OpenVPN 2.3.13客户端软件.当VPN连接处于活动状态时,“以太网2”(TAP接口)连接将通过NLA与主LAN NIC一起置于域网络类别中.理想情况下,我希望能够将VPN接口分配给公共类别.我尝试过PowerShell,但不断得

我有一个域加入了 Windows Server 2012 R2,其上安装了OpenVPN 2.3.13客户端软件.当VPN连接处于活动状态时,“以太网2”(TAP接口)连接将通过NLA与主LAN NIC一起置于域网络类别中.理想情况下,我希望能够将VPN接口分配给公共类别.我尝试过PowerShell,但不断得到这个错误:

Unable to set the NetworkCategory due to one of the following possible
reasons: not running PowerShell elevated; the NetworkCategory cannot
be changed from ‘DomainAuthenticated’; user initiated changes to
NetworkCategory are being prevented due to the Group Policy setting
‘Network List Manager Policies’. At line:1 char:1
+ Set-NetConnectionProfile -InterfaceIndex 15 -NetworkCategory Public
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (MSFT_NetConnect…72AADA665483}”):root/StandardCi…nnectionProfile)
[Set-NetConnectionProfile],CimException
+ FullyQualifiedErrorId : MI RESULT 2,Set-NetConnectionProfile

15是“以太网2”的接口号

值得注意的是,我在一个提升的PowerShell会话中运行此命令,并且我尝试了所有可用的GPO策略但是错误一直被抛出.关于NLA的大多数信息表明私人和公共之间的转换应该有效,但DomainAuthenicated似乎有点不同.

注册表方法没有以太网2的实际配置文件,因此也不能以这种方式更改.

反正有没有强制TAP适配器公开? OpenVPN连接本身不会覆盖主NIC的默认网关,并使用10.0.0.0/8子网.我使用route-nopull并覆盖路由的事实可能是NLA检测网络的方式的问题的一部分.

Ethernet adapter Ethernet 2:

Connection-specific DNS Suffix  . :
Link-local IPv6 Address . . . . . : fe80::xxxx:xxxx:xxxx:xxxx%xx
IPv4 Address. . . . . . . . . . . : 10.xx.xx.xx
Subnet Mask . . . . . . . . . . . : 255.255.255.252
Default Gateway . . . . . . . . . :

需要分配公共配置文件的主要原因是防火墙规则,我无法阻止某些应用程序仅使用VPN接口,能够编写基于网络配置文件的防火墙规则似乎在这种情况下效果最好,我试过根据本地IP地址编写规则,但这不起作用.

以下将使用WMI / CIM.
get-ciminstance -Namespace root/StandardCimv2 -ClassName MSFT_NetConnectionProfile -Filter "interfacealias='Ethernet 2'" | set-ciminstance -property @{NetworkCategory="1"}

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读