micahmo / WgServerforWindows

Wg Server for Windows (WS4W) is a desktop application that allows running and managing a WireGuard server endpoint on Windows
MIT License
818 stars 78 forks source link

cant enable private network #126

Open thebwistic opened 10 months ago

thebwistic commented 10 months ago

image

Im trying to click the private network button but it isn't changing

micahmo commented 10 months ago

Hi @thebwistic, sorry to hear about this!

Let's see if we can change the adapter settings directly. Can you try running these three commands from an admin PowerShell?

$network = Get-NetConnectionProfile -InterfaceAlias "wg_server"
$network.NetworkCategory = "Private"
Set-NetConnectionProfile -InputObject $network

Let's start here before moving on to your other issue.

thebwistic commented 10 months ago

image

ok, i've run the given commands and then retried with making the network private on the wg server app. so far its still not working

micahmo commented 10 months ago

Those commands are supposed to make the network private, so you shouldn't need to press that option in the UI again. Try running the commands, then just open a fresh instance of WS4W and see if the status is any different.

Also I added one more line to the commands which is supposed to print out the current profile. It'll be interesting to see if even setting it from PowerShell fails.

$network = Get-NetConnectionProfile -InterfaceAlias "wg_server"
$network.NetworkCategory = "Private"
Set-NetConnectionProfile -InputObject $network
$network = Get-NetConnectionProfile -InterfaceAlias "wg_server"
echo $network.NetworkCategory

BTW, are you on a domain?

thebwistic commented 10 months ago

No I am not.

thebwistic commented 10 months ago

Its still not working. i reinstalled wg server. private network still cannot be opened

micahmo commented 10 months ago

Hey @thebwistic I'm a bit stumped by this. If you can't set the adapter to Private using PowerShell, then it sounds like a Windows problem. The only other thing I can think to try is setting this in the registry.

Try going to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\ and find the adapter that corresponds to wg_server. Try setting Category to 1.

image