![Windows Server 2019 始终更改所有网络适配器的 NetworkCategory,即使只更改了一个](https://linux22.com/image/742181/Windows%20Server%202019%20%E5%A7%8B%E7%BB%88%E6%9B%B4%E6%94%B9%E6%89%80%E6%9C%89%E7%BD%91%E7%BB%9C%E9%80%82%E9%85%8D%E5%99%A8%E7%9A%84%20NetworkCategory%EF%BC%8C%E5%8D%B3%E4%BD%BF%E5%8F%AA%E6%9B%B4%E6%94%B9%E4%BA%86%E4%B8%80%E4%B8%AA.png)
我有一台带有两张网卡的 Windows Server 2019。一张带有公共 IP,一张带有私有 IP。现在 Windows 会自动将两个适配器设置为使用“公共配置文件”。我想做的是只将一个网络适配器从公共设置为私有。
像这样:
PS C:\Users\Administrator> Get-NetConnectionProfile
Name : Netzwerk
InterfaceAlias : Ethernet 2
InterfaceIndex : 2
NetworkCategory : Public <----- Both are set to public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
Name : Netzwerk
InterfaceAlias : Ethernet
InterfaceIndex : 16
NetworkCategory : Public <----- Both are set to public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
PS C:\Users\Administrator> Set-NetConnectionProfile -InterfaceIndex 2 -NetworkCategory private
PS C:\Users\Administrator> Get-NetConnectionProfile
Name : Netzwerk
InterfaceAlias : Ethernet 2
InterfaceIndex : 2
NetworkCategory : Private <----- Now BOTH are set to private
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
Name : Netzwerk
InterfaceAlias : Ethernet
InterfaceIndex : 16
NetworkCategory : Private <----- Now BOTH are set to private
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
PS C:\Users\Administrator>
因此:当改变一个适配器的网络类型时,实际上两个适配器都会改变。
对此有什么想法吗?
谢谢!