windows install service
"C:\Program Files\WireGuard\wireguard.exe" /installtunnelservice "C:\wireguard\wg_server.conf"
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\wireguard\wireguard.psm1
Function Set-NetConnectionSharing { Param ( [Parameter(Mandatory=$true)] [string] $LocalConnection, [Parameter(Mandatory=$true)] [bool] $Enabled ) Begin { $netShare = $null try { # Create a NetSharingManager object $netShare = New-Object -ComObject HNetCfg.HNetShare } catch { # Register the HNetCfg library (once) regsvr32 /s hnetcfg.dll # Create a NetSharingManager object $netShare = New-Object -ComObject HNetCfg.HNetShare } } Process { #Clear Existing Share $oldConnections = $netShare.EnumEveryConnection |? { $netShare.INetSharingConfigurationForINetConnection.Invoke($_).SharingEnabled -eq $true} foreach($oldShared in $oldConnections) { $oldConfig = $netShare.INetSharingConfigurationForINetConnection.Invoke($oldShared) $oldConfig.DisableSharing() } # Find connections $InternetConnection = Get-NetRoute | ? DestinationPrefix -eq '0.0.0.0/0' | Get-NetIPInterface | Where ConnectionState -eq 'Connected' $publicConnection = $netShare.EnumEveryConnection |? { $netShare.NetConnectionProps.Invoke($_).Name -eq $InternetConnection.InterfaceAlias } $privateConnection = $netShare.EnumEveryConnection |? { $netShare.NetConnectionProps.Invoke($_).Name -eq $LocalConnection } # Get sharing configuration $publicConfig = $netShare.INetSharingConfigurationForINetConnection.Invoke($publicConnection) $privateConfig = $netShare.INetSharingConfigurationForINetConnection.Invoke($privateConnection) if ($Enabled) { $publicConfig.EnableSharing(0) $privateConfig.EnableSharing(1) } else { $publicConfig.DisableSharing() $privateConfig.DisableSharing() } } }
to private
$NetworkProfile = Get-NetConnectionProfile -InterfaceAlias "wg_server" $NetworkProfile.NetworkCategory = "Private" Set-NetConnectionProfile -InputObject $NetworkProfile
reboot 하고나서
admin
Set-ExecutionPolicy RemoteSigned Import-Module wireguard Set-NetConnectionSharing "wg_server" $true
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedAccess] "EnableRebootPersistConnection"=string:1 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SharedAccess\Parameters] "ScopeAddress"=string:192.168.200.1 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SharedAccess\Parameters] "ScopeAddressBackup"=string:192.168.200.1 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SharedAccess\Parameters] "StandaloneDHCPAddress"=string:192.168.200.1
windows
How to Setup Wireguard VPN Server On Windows - Henry's Portal
This tutorial goes through the process of setting up a Wireguard server on Windows. Most Wireguard tutorials on the internet only give you the choice of hosting a server in a Linux environment. However, it is very possible to setup a windows server.
https://www.henrychang.ca/how-to-setup-wireguard-vpn-server-on-windows/

PowerShell says "execution of scripts is disabled on this system."
Asked I am trying to run a cmd file that calls a PowerShell script from cmd.exe, but I am getting this error: Management_Install.ps1 cannot be loaded because the execution of scripts is disabled on this system. I ran this command: Set-ExecutionPolicy -ExecutionPolicy Unrestricted When I run Get-ExecutionPolicy from PowerShell, it returns Unrestricted.
https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system
wsl2
Installing WireGuard in WSL 2
There's been a lot of buzz about WireGuard recently, primarily because of it getting merged into the Linux Kernel for 5.6. So much so that even my friends started reaching out: So I decided to take a look. I primarily run Windows, but most of my ork is in Linux, therefore I spend a lot of time in WSL 2.
https://centerorbit.medium.com/installing-wireguard-in-wsl-2-dd676520cb21

WSL 2 does not have /lib/modules/
I have the source code of a hello world kernel module that works in Ubuntu 20 in a laptop. Now I am trying to compile the same code in Ubuntu 20 but inside WSL2. For that I am using this: make -C /...
https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules

