Windows recognizing Wireguard as a public network

Is there any way to make the latest Windows 10 recognize a Wireguard VPN connection as a Private Network rather than a Public Network?

This ends up leading the Windows Firewall into blocking any inbound connections to the SMB file shares. So, I have to either edit Advanced Firewall Rules (annoying/complicated) OR I have to turn the firewall off entirely.

I actually just completed an article on this topic. Should be published to www.smarthomebeginner.com in the next week.

The short answer is to open Powershell as admin, then use:

Set-NetConnectionProfile -InterfaceAlias 'wg0' -NetworkCategory 'Private'

Replace wg0 with the name of your interface.

I also wrote a small script to accomplish this but you have to enable untrusted scripts which is another issue.

Powershell or Regedit:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles
Change “Category” from 0 to 1

You cab use powershell to accomplish this with other “Networks”.

Net-connectionprofile or something like that.

Brilliant. Thanks.

I set my Wireguard network as Private and disabled the Firewall on Private Networks.

I couldn’t let in direct IP connections to SMB on my Windows box come thru otherwise.

There are some complicated firewall rules in place by Windows that I don’t understand.

I hate replying to such an old comment, but this was the perfect solution. Thank you very much!

Even better. Thanks.

Thank you. I couldn’t easily see what the interface was called because the Windows UI was hiding it from me from most screens, so the Powershell option didn’t work.

Regedit was a piece of cake, thanks! I hate how buried they make that public/private selection. Sometimes I deal with that by just browsing the “Network” in File Explorer, but in this case I was connected to two networks, so it didn’t give me the “easy” option to switch the network to private.

Ya windows networking in general is a bit of a nightmare for the average user anyways.

Glad it’s working!