Windows Networking - KirbyLV/D3-Propellerhead-Wiki GitHub Wiki
Windows Adapter Settings
[Start]
Ncpa.cpl
[enter]
Private Networks
The easiest way I have found to define network connections as public or private is via Microsoft PowerShell. Ensure you are running PowerShell Elevated (Run as Administrator) and execute the following code:
get-netconnectionprofile
You should receive a response that looks like the following:
PS C:\Users\Redshift> get-netconnectionprofile`
Name : Network 9
InterfaceAlias : NIC B - D3
InterfaceIndex : 7
NetworkCategory : Private
DomainAuthenticationKind : None
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
Name : Unidentified network
InterfaceAlias : NIC C 10Gb - Media
InterfaceIndex : 9
NetworkCategory : Public
DomainAuthenticationKind : None
IPv4Connectivity : LocalNetwork
IPv6Connectivity : NoTraffic
Pay special attention to the numbers listed next to “InterfaceIndex” and the type listed next to “NetworkCategory”. In this instance, our media network on NIC C 10Gb – Media has an interface index of “9” and is set to public. We want to change this to private. In order to do so, we execute the following command:
set-netconnectionprofile -interfaceindex [index found in above response] -networkcategory [public or private]
So, in this case, we enter the following:
set-netconnectionprofile -interfaceindex 9 -networkcategory private
To confirm our command worked, you can run the get-netconnectionprofile command again and read the results. You want the interfaces that are used for content sharing and server control to be private. It should look smoothing like the following:
PS C:\Users\Redshift> set-netconnectionprofile -interfaceindex 9 -networkcategory private
PS C:\Users\Redshift> get-netconnectionprofile`
Name : Network 9
InterfaceAlias : NIC B - D3
InterfaceIndex : 7
NetworkCategory : Private
DomainAuthenticationKind : None
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
Name : Unidentified network
InterfaceAlias : NIC C 10Gb - Media
InterfaceIndex : 9
NetworkCategory : Private
DomainAuthenticationKind : None
IPv4Connectivity : LocalNetwork
IPv6Connectivity : NoTraffic
Troubleshooting Private Network Commands
Occasionally on some Windows PCs, there are group policies established that prevent the above commands from being executed, even with administrator priveleges. After trying to run a set-netconnectionprofile command, you may be met with the following response:
set-netconnectionprofile : 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 9 -networkcategory private
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (MSFT_NetConnect ... }"):root/Standard...Profile)
[Set-NetConnectionProfile], CimException
+ FullyQualifiedErrorId : MI Result 2, Set-NetConnectionProfile
If you receive the above message, and you are sure you are running PowerShell Elevated (runs s Administrator), you will likely need to edit a group policy within the PC. Open the “Local Group Policy Editor” by searching for “edit group policy” under the start menu.
Navigate to Local Computer Policy > Windows Settings > Security Settings > Network List Manager Policies and double click on “All Networks”.
In the resulting dialog, change the value under “Network Location” to select the radial next to “User can change location”
After this change is applied, try to run the command in PowerShell Elevated again.
Set IP via Command Line
Using Netsh to set details
netsh interface ipv4 show config
Take note of the interface name within quotations. Then:
netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY
For example:
netsh interface ipv4 set address name="Ethernet 4" static 10.22.22.110 255.255.255.0 10.22.22.1