How to force “Private network” in an Unidentified network on Windows 10
I have a workstation with 2 network adapters, one is connected to a domain network, the other one is connected to a device, you can think of this device like a raspberry pi, via an integrated network adapter onboard. The workload is to execute a couple of tasks while connected to the device, like SSH, SFTP push, TFTP server, etc. and once finished move to the next device and repeat.
Sometimes the windows firewall gets in the way to complete these tasks, the hot fix being turning it off completely and I would like to address this issue.
Each time I change the device windows tries to “Identify” the network, and once it sets it up as unidentified defaults the network profile to “Public”
I’ve tried the PS commands:
PS C:\Users\User> Get-NetConnectionProfile
Name : contoso.com
InterfaceAlias : Ethernet
InterfaceIndex : 5
NetworkCategory : DomainAuthenticated
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
Name : Unidentified network
InterfaceAlias : Ethernet 4
InterfaceIndex : 8
NetworkCategory : Public
IPv4Connectivity : LocalNetwork
IPv6Connectivity : NoTraffic
PS C:\Users\User> Set-NetConnectionProfile -InterfaceAlias "Ethernet 4" -NetworkCategory Private
But it defaults each time I change devices, I might be able to tie this cmdlet to an event, but I don’t know which one.
other things that come to mind are:
- Opening the firewall ports used by the protocols required on the public profile. But this might get overwritten by group policy.
- Forcing the link to UP, that way windows doesn’t tries to identify the network, but I don’t know if windows is capable of this
- Changing in
Control Panel\Network and Internet\Network and Sharing Center\Advanced sharing settings
the settings regarding Guest or Public
Any suggestions?