question

Alexander-6621 avatar image
0 Votes"
Alexander-6621 asked Alexander-6621 commented

Windows 2019 change Network profil for two virtual Network adapters

I have installed a Windows 2019 server on a vServer which is hosted by Hetzner.com
The server has a public IP and a privat IP.

In the spirit of Windows Firewall, I would like to turn on the firewall for Public and turn it off for the private network.

Since the installation, both network cards are in the "Public" network profile.

I would like to change the network card of the internal network from Public to Private.

I tried to change the network profile of the private IP to "Private" with the Powershell but then both network cards are assigned to the network profile "Private" although I only addressed the InterfaceIndex of the network card of the private network.

Powershel:
Get-NetConnectionProfile

Name : Network
InterfaceAlias : Public
InterfaceIndex : 14
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic

Name : Network
InterfaceAlias : Internal
InterfaceIndex : 8
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic


Powershell

Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory Private
Unfortunately both interfaces change to Private although the InterfaceIndex is different.

I also tried InterfaceAlias ... the same result.


I also try it with the GUI

 Open Windows Firewall with Advanced Security
 Click on Windows Firewall Properties
 Click the Private Profile Tab
 Click Customize
 Select the Interface I want (private)
 Click OK
 Repeat step 3-6 for the public profile

but if I call Get-NetConnectionProfile both are Public?

Has it something to do with the Network Name? Both Networks are named "Network"?

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles

... shows me only one network profile.


windows-server
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ElevenYu-MSFT avatar image
0 Votes"
ElevenYu-MSFT answered Alexander-6621 commented

Hi,

Thank you for posting the question to Q&A forum.

Yes, your understanding is correct. From your result of "Get-NetConnectionProfile", there is only one Network Profile on your server. That means both network adapters are identified to connect to the same network.

You can only change the network types for specific network profile. Since both adapters are under the same network profile, both will be changed to "public" or "private".

Please check your network settings to ensure the network adapters are connected to different networks. If you have any problem on network configuration, we suggest that you could raise a new post to network forum.


Thanks,


If the Answer is helpful, please click "Accept Answer" and upvote it. Thanks.

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Alexander-6621,

You might need to ensure that the two network adapters are not connected to the same virtual switch.




0 Votes 0 ·

Hi, thank you for your answer.
I am not sure what you mean.
In Windows 2019 I have two Network Cards and I thought that they are independent.
The Server is a virtual server and I have no access to the host.
I can't tell the provider to which switch they should connect.

0 Votes 0 ·

If the two network cards are connected to the same switch, the NLA (Network Location Awareness) service will determine the two network cards are connected to the same network. Just like your PowerShell result shows, both your two network cards are under the same network named "Network“. So, there is only one network profile called "Network" for both the network cards.

Maybe you can raise a post to Hetzner forum or contact Hetzner support to check if there is any further solution.


0 Votes 0 ·

Thank you for your detailed explanation.

0 Votes 0 ·

Hi @Alexander-6621,

It will be much appreciated and encouraged if you could click "Accept Answer" and upvote for my reply.

In this way, other users could quickly identify which is the useful information for similar question.

Thanks for your understanding.

0 Votes 0 ·