Wireguard client windows
Author: k | 2025-04-24
Set up WireGuard client on Windows 10; Set up WireGuard client on macOS Catalina; Set up WireGuard client on iOS 13; Set up WireGuard client on Android; Hope this
wireguard-windows - WireGuard client for Windows - ZX2C4
I get the following error when running as a non-admin: WireGuard is running, but the UI is only accessible from desktops of the Builtin AdministratorsHow do I enable wireguard for win10 to work with just a regular user? asked Oct 3, 2019 at 16:19 2 At present what you ask is not possible, on Windows. Unlike other VPN tools and technologies, the Wireguard client creates a tunnel interface (showing up as a network adapter) for each connection you have configured when you try to connect, aka "on the fly". When you terminate the connection the client deletes the tunnel interface entirely. It does this outside the official VPN plumbing of Windows. That design has the severe limitation that you need to be an administrator of the machine so the software can create the interface.I use Wireguard on Windows, Mac, and Linux. Windows is the only platform I have this issue with. Additionally, I only use the official client (version 0.38 at the time of this writing) from Wireguard. I do not know if there are others. answered Feb 24, 2020 at 19:26 As previous solutions and comments have pointed out, activating a wireguard (WG) tunnel is not possible - the action requires privilege elevation of some kind.The solutions mentioned so far have some downsides, at least in my use case. For completeness I'll list all solutions mentioned and add mine.Normal WG installation, switch to administrator user to activate Wireguard, then switch back.Pro: admin user has access to all features of WG GUICon: it takes time & clicks to switch usersNormal WG installation, add HKLM\Software\WireGuard\LimitedOperatorUI registry key and add user to Network Configuration Operators groupsee WG registry keys documentationPro: WG GUI accessibleCon: messing with registry, GUI functionality severely limited, messes with privilege elevation promptThe last point needs clarification: when working as Tunnel service will automatically be updated via the wg syncconf command (if the newly saved server configuration is valid). This is also true of the client configurations, updates to which often cause the server configuration to be updated (e.g., if a new client is added, the server configuration must be aware of this new peer).Private NetworkEven after the tunnel service is installed, some protocols may be blocked. It is recommended to change the network profile to Private, which eases Windows restrictions on the network.This step also creates a Windows Task to make the network Private automatically on boot. You may disable the Task via the dropdown.Note: On a system where the shared internet connection originates from a domain network, this step is not necessary, as the WireGuard interfaces picks up the profile of the shared domain network.RoutingThe last step is to allow requests made over the WireGuard interface to be routed to your private network or the Internet. To do so, the connection of the "real" network adapter on the Windows machine must be shared with the virtual WireGuard adapter. This can be done in one of two ways.NAT RoutingInternet Sharing + Persistent Internet SharingThe first option is only available on some systems (see more below). The second options may be used as necessary, but have some caveats (such as, if the Internet Connection is shared with the WireGuard adapter, it cannot be shared with any other adapter; see #18). There have also been multiple issues reported with Internet Sharing, so NAT Routing should be used if available.These options are mutually exclusive.NAT RoutingHere you can create a NAT routing rule on the WireGuard interface to allow it to interact with your private/public network. Specifically, the following commands are invoked.New-NetIPAddress is called on the WireGuard adapter to assign a static IPbuildrun.md docs - wireguard-windows - WireGuard client for Windows
Reserved for the server. DNS is optional, but recommended. You may add DNS Search Domains (also known as DNS Suffixes, read more). Lastly, the Private Key, Public Key, and Preshared Key are generated using wg genkey, wg pubkey [private key], and wg genpsk. (You may specify your own Private Key. Preshared Keys are optional, generated uniquely per-client, and shared with the server's configuration. See #34 for more info.)Due to a bit of a quirk in WireGuard, if you were to remove a client Preshared Key and sync the server configuration, WireGuard would still expect the client to connect with a PSK. Therefore, WS4W does not allow you to clear the Preshared Key field from clients. Instead, delete and recreate a client to remove the PSK.Once configured, it's easy to import the configuration into your client app of choice via QR code or by exporting the .conf file.For security, you may not want to keep the clients' private keys on the server. In that case, you may clear the private key field before saving a client configuration. However, there are two things to keep in mind.You should export the client config (via QR code or file) before removing the private key and saving.If you ever need to import the config to your client again, you will have to re-generate both the private and public keys.Tunnnel ServiceOnce the server and client(s) are configured, you may install the tunnel service, which creates a new network interface for WireGuard using the wireguard /installtunnelservice command. After installation, the tunnel may be also removed directly within WS4W. This uses the wireguard /uninstalltunnelservice command.After completing this step, WireGuard clients should be able to get as far as performing a successful handshake with the server.Note: If the server configuration is edited after the tunnel service is installed, the. Set up WireGuard client on Windows 10; Set up WireGuard client on macOS Catalina; Set up WireGuard client on iOS 13; Set up WireGuard client on Android; Hope thisWireGuard - How to Install and Configure WireGuard Client on Windows
The user the ability to freely start and stop the Wireguard tunnel.Since Wireguard runs as a service in Windows, you can change the permissions for that service, without having to give the user more privilege than it needs to have.Configure the Wireguard tunnel on the machine using an admin account and the GUI then start the tunnelOpen a command prompt and change the permissions for the servicesc.exe sdset WireGuardTunnel$NameOfTheTunnel "D:AR(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWRPWPDTLOCRRC;;;WD)(A;;CCLCSWLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"You can then start and stop the tunnel using those commands. Don't use the GUI to start/stop at this pointsc stop WireGuardTunnel$NameOfTheTunnelsc start WireGuardTunnel$NameOfTheTunnelCreate a batch file, one for each command, like WireguardON.bat and WiregaurdOFF.bat and put them somewhere the client could access (on its desktop or something)Logout and log back in with the user account. It should be able to start and stop the service, even after a reboot. answered Jun 23, 2022 at 18:03 1 All other solutions to this problem are not ideal. The methods I've seen are:Just running as an adminAdding the user account to the Network Configuration OperatorsPros: Wireguard gui, works smoothlyCons: Your regular user gets added to an admin group and will appear in UAC prompts. This is very annoying and probably bad security.Running the WireGuard tunnel as a windows service (as suggested in this answer)Pros: Works perfectlyCons: No gui, needs an elevated console.Using Task Scheduler as in this answer (didn't work for me at all).Solution:Install the latest MSI: run this command in elevated console with your .conf file:wireguard /installtunnelservice C:\path\to\some\myconfname.confThis creates a service called WireGuardTunnel$myconfname, which can be controlled using standard Windows service management utilites, such as services.msc or sc.— sourceControl the service with "ServiceTray": give you a nice icon on the system tray that shows the up status of the WireGuard tunnel service. Green = connected, red = not connected, and you can How to install Wireguard on your Windows Server.If you are looking to install Wireguard on your Windows Server or Windows 10 / 11 then follow these instructions.Step 1: Download the latest ‘Wg Server for Windows’ from Github – the latest .exe under the latest releases link on that page.Step 2: Run the WS4WSetup…exe and next all the way through.It may install the ‘Microsoft Windows Desktop Runtime – 3.1.21 (x64)’ at the end – So allow that to fully install.Step 3: Open the now installed WS4W application and click to install ‘Wireguard.exe’ which is first on the list.When its done – a popup window will appear saying ‘import tunnels’ – just close that. Job done.Step 4: Now go to ‘Server Configuration’Enter any ‘Name’ at the top.Leave listen port on 51820Leave Allowed IPs as 0.0.0.0/0Click ‘Detect Public IP Address’ and it should auto detect the public IP.*** Make sure you MAP A FIREWALL PORT for port 51820 as UDP on your hardware firewall *** Note that it must be a UDP mapped port – you do not need TCP for this.The endpoint will show as MYIPADDRESS:51820Then under ‘Address’ below just leave it as 10.253.0.0/24Click ‘Generate’ on Private and Public Key.Now SAVE.Step 5: Open the ‘Client Configuration’Hit the ‘Add Client’ button.Put an relevant name in the ‘Name’ section.Next in the ‘Address’ section press Generate from Server.In ‘Allowed IPs’ leave it as 0.0.0.0/0 to allow any external IP to connect.DNS put in your preferred server or use 8.8.8.8, 1.1.1.1 as a universal option.Leave theWindows WireGuard Client Fails to Handshake : r/WireGuard
Behind NAT# PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o ensX -j MASQUERADE# PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o ensX -j MASQUERADEStep 3: Enable and Start WireGuardsudo wg-quick up wg0sudo systemctl enable wg-quick@wg0Step 4: Set up IP forwarding and firewall rules:Enabling IP forwarding is essential when configuring VPNs like WireGuard, as it allows the system to route packets between different network interfaces.echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.confsudo sysctl -pStep 5: Create New UsersNow, let’s create new users and generate their private and public keys.Step 1:Generate private and public keys for each user:wg genkey | sudo tee /etc/wireguard/client_privatekey1 | wg pubkey | sudo tee /etc/wireguard/client_publickey1wg genkey | sudo tee /etc/wireguard/client_privatekey2 | wg pubkey | sudo tee /etc/wireguard/client_publickey2# Generate keys for more users as neededStep 2:Create a new configuration file for each user. Replace user1 and user2 with your desired usernames:sudo nano /etc/wireguard/user1.confStep 3:Add the following content to each user’s configuration file, replacing the placeholders with the corresponding keys and server’s public IP address:[Interface]PrivateKey = Address = 10.0.0.2/32 # Assign a unique IP address for each userDNS = 8.8.8.8 # Optional: Set preferred DNS server[Peer]PublicKey = AllowedIPs = 0.0.0.0/0Endpoint = YOUR_SERVER_PUBLIC_IP:51820Replace with the content of the corresponding client private key and with the content of /etc/wireguard/publickey generated earlier. Modify the IP address and DNS settings as desired.Step 4: Save and close each user’s configuration file.This file gets used with the WireGuard client to connect toWindows WireGuard Client: On Demand Activation : r/WireGuard
MotivationI have wireguard vpn servers in multiple locations and i neededto dynamically load my firewall every time i change vpn connection formy host machine.To keep my connection location and browsing secure, I implemented a vpn kill switch.This code:- installs firewall and configures it to start at boot.- installs software to change vpn configuration with the option to set vpn to persistent (start at boot).Prereqs:Install wireguard (wg) server and generate your client config filesConfigure wg server: your client config files and move them to /etc/wireguard directoryInstall wg client on Linux: codegit clone && cd vpnKillSwitchSetupedit the env to set your default wg client config name (without the .conf extension).if not set then default name would be tun0.tunnel="default_client_name"edit firewall configurationInstall vpn kill switch firewall in linuxFrom vpnKillSwitch directory (folder)# Make scripts executablechmod +x *.sh && chmod +x vpnKillSwitch/*.sh# Set correct file permissionschmod 0644 systemd/vpnKillSwitch.servicechmod 744 vpnKillSwitch/*.shchmod 600 vpnKillSwitch/env# Enable and start wg vpn firewall at bootsudo cp systemd/vpnKillSwitch.service /etc/systemd/systemsudo cp -R vpnKillSwitch /etc/sudo systemctl daemon-reloadsudo systemctl enable vpnKillSwitch.servicesudo systemctl start vpnKillSwitch.service# If you want to disable ipv6, run commands below:# if you disable ipv6 make sure to REMOVE ipv6 address from your wireguard configuration file# that's located in "/etc/wireguard", otherwise connection will not work properly.# echo 'net.ipv6.conf.all.disable_ipv6=1' | sudo tee -a /etc/sysctl.conf# echo 'net.ipv6.conf.default.disable_ipv6=1' | sudo tee -a /etc/sysctl.conf# echo 'net.ipv6.conf.lo.disable_ipv6=1' | sudo tee -a /etc/sysctl.conf# sudo sysctl -pLoad wireguard configurationsynopsis: sudo ./load-wg-conf.sh [wg config name] [persistent after boot (optional): [y|n]]example 1:sudo ./load-wg-conf.sh wg0 yexample 2:sudo ./load-wg-conf.sh wg0.conf nexample 2a:# persistent automatically set to nosudo ./load-wg-conf.sh wg0Stop vpnKillSwitch service# temporarily stop the vpn firewall (open ports / disable firewall) - however will restart at bootupsudo systemctl stop vpnKillSwitch.serviceDisable vpnKillSwitch service# Disable firewall so it won't start at boot upsudo systemctl stop vpnKillSwitch.service. Set up WireGuard client on Windows 10; Set up WireGuard client on macOS Catalina; Set up WireGuard client on iOS 13; Set up WireGuard client on Android; Hope thisBest WireGuard Windows client : r/WireGuard - Reddit
Mod info Secure your connection using SSH, Shadowsocks or V2Ray tunnelSSL/TLS tunneling is supportedDNS tunnelingNo root neededSpecify alternate proxy servers to send a request throughDNS ChangerSupport Android 4.0 to Android 11Hotshare - Tether UnlockAbility to change buffer size, etc Description from Developer DetailHTTP Injector is a professional VPN tool to browse the Internet privately and securely with multiple protocol and tunneling technologies build into one appIt works as an universal VPN (SSH/Proxy/SSL Tunnel/DNS Tunnel/Shadowsocks/V2Ray/Xray/Hysteria/Wireguard) client to encrypts your connection so that you can surf the internet privately and securely. Besides that, it also help you access blocked websites behind firewall. Best part? you can configure your own server and connect using this app.PLEASE READ DESCRIPTION BEFORE YOU DOWNLOADThis tools is for professional users onlyAccess any website and service on the Internet and secure your identity. Secure your device from hackers and online threats when using a public WiFi and forget about geo-locked content, identity theft and online privacy concerns.Features:- Secure your connection- SSL/TLS tunneling- DNS tunneling (DNSTT / SlowDNS)- SSH, Shadowsocks or V2Ray/Xray tunnel- Wireguard- Specify alternate proxy servers to send a request through- DNS Changer- Build in SSH client- Build in Shadowsocks client- Build in V2ray/Xray client- Build in Wireguard client- Build in Host Checker and IP Hunter- Payload Generator- Apps Filter- Support Android 5.0 to Android 14- Google DNS / Custom DNS- Data Compression- Hotshare - Tether Unlock- Ability to change buffer size, etcTunnel Types- SSH- SSL (TLS)- VMess, VLESS, SOCKS- DNS Tunnel (DNSTT)- Hysteria (QUIC UDP/SlowUDP)- Wireguard-Comments
I get the following error when running as a non-admin: WireGuard is running, but the UI is only accessible from desktops of the Builtin AdministratorsHow do I enable wireguard for win10 to work with just a regular user? asked Oct 3, 2019 at 16:19 2 At present what you ask is not possible, on Windows. Unlike other VPN tools and technologies, the Wireguard client creates a tunnel interface (showing up as a network adapter) for each connection you have configured when you try to connect, aka "on the fly". When you terminate the connection the client deletes the tunnel interface entirely. It does this outside the official VPN plumbing of Windows. That design has the severe limitation that you need to be an administrator of the machine so the software can create the interface.I use Wireguard on Windows, Mac, and Linux. Windows is the only platform I have this issue with. Additionally, I only use the official client (version 0.38 at the time of this writing) from Wireguard. I do not know if there are others. answered Feb 24, 2020 at 19:26 As previous solutions and comments have pointed out, activating a wireguard (WG) tunnel is not possible - the action requires privilege elevation of some kind.The solutions mentioned so far have some downsides, at least in my use case. For completeness I'll list all solutions mentioned and add mine.Normal WG installation, switch to administrator user to activate Wireguard, then switch back.Pro: admin user has access to all features of WG GUICon: it takes time & clicks to switch usersNormal WG installation, add HKLM\Software\WireGuard\LimitedOperatorUI registry key and add user to Network Configuration Operators groupsee WG registry keys documentationPro: WG GUI accessibleCon: messing with registry, GUI functionality severely limited, messes with privilege elevation promptThe last point needs clarification: when working as
2025-04-06Tunnel service will automatically be updated via the wg syncconf command (if the newly saved server configuration is valid). This is also true of the client configurations, updates to which often cause the server configuration to be updated (e.g., if a new client is added, the server configuration must be aware of this new peer).Private NetworkEven after the tunnel service is installed, some protocols may be blocked. It is recommended to change the network profile to Private, which eases Windows restrictions on the network.This step also creates a Windows Task to make the network Private automatically on boot. You may disable the Task via the dropdown.Note: On a system where the shared internet connection originates from a domain network, this step is not necessary, as the WireGuard interfaces picks up the profile of the shared domain network.RoutingThe last step is to allow requests made over the WireGuard interface to be routed to your private network or the Internet. To do so, the connection of the "real" network adapter on the Windows machine must be shared with the virtual WireGuard adapter. This can be done in one of two ways.NAT RoutingInternet Sharing + Persistent Internet SharingThe first option is only available on some systems (see more below). The second options may be used as necessary, but have some caveats (such as, if the Internet Connection is shared with the WireGuard adapter, it cannot be shared with any other adapter; see #18). There have also been multiple issues reported with Internet Sharing, so NAT Routing should be used if available.These options are mutually exclusive.NAT RoutingHere you can create a NAT routing rule on the WireGuard interface to allow it to interact with your private/public network. Specifically, the following commands are invoked.New-NetIPAddress is called on the WireGuard adapter to assign a static IP
2025-04-02Reserved for the server. DNS is optional, but recommended. You may add DNS Search Domains (also known as DNS Suffixes, read more). Lastly, the Private Key, Public Key, and Preshared Key are generated using wg genkey, wg pubkey [private key], and wg genpsk. (You may specify your own Private Key. Preshared Keys are optional, generated uniquely per-client, and shared with the server's configuration. See #34 for more info.)Due to a bit of a quirk in WireGuard, if you were to remove a client Preshared Key and sync the server configuration, WireGuard would still expect the client to connect with a PSK. Therefore, WS4W does not allow you to clear the Preshared Key field from clients. Instead, delete and recreate a client to remove the PSK.Once configured, it's easy to import the configuration into your client app of choice via QR code or by exporting the .conf file.For security, you may not want to keep the clients' private keys on the server. In that case, you may clear the private key field before saving a client configuration. However, there are two things to keep in mind.You should export the client config (via QR code or file) before removing the private key and saving.If you ever need to import the config to your client again, you will have to re-generate both the private and public keys.Tunnnel ServiceOnce the server and client(s) are configured, you may install the tunnel service, which creates a new network interface for WireGuard using the wireguard /installtunnelservice command. After installation, the tunnel may be also removed directly within WS4W. This uses the wireguard /uninstalltunnelservice command.After completing this step, WireGuard clients should be able to get as far as performing a successful handshake with the server.Note: If the server configuration is edited after the tunnel service is installed, the
2025-04-02The user the ability to freely start and stop the Wireguard tunnel.Since Wireguard runs as a service in Windows, you can change the permissions for that service, without having to give the user more privilege than it needs to have.Configure the Wireguard tunnel on the machine using an admin account and the GUI then start the tunnelOpen a command prompt and change the permissions for the servicesc.exe sdset WireGuardTunnel$NameOfTheTunnel "D:AR(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWRPWPDTLOCRRC;;;WD)(A;;CCLCSWLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"You can then start and stop the tunnel using those commands. Don't use the GUI to start/stop at this pointsc stop WireGuardTunnel$NameOfTheTunnelsc start WireGuardTunnel$NameOfTheTunnelCreate a batch file, one for each command, like WireguardON.bat and WiregaurdOFF.bat and put them somewhere the client could access (on its desktop or something)Logout and log back in with the user account. It should be able to start and stop the service, even after a reboot. answered Jun 23, 2022 at 18:03 1 All other solutions to this problem are not ideal. The methods I've seen are:Just running as an adminAdding the user account to the Network Configuration OperatorsPros: Wireguard gui, works smoothlyCons: Your regular user gets added to an admin group and will appear in UAC prompts. This is very annoying and probably bad security.Running the WireGuard tunnel as a windows service (as suggested in this answer)Pros: Works perfectlyCons: No gui, needs an elevated console.Using Task Scheduler as in this answer (didn't work for me at all).Solution:Install the latest MSI: run this command in elevated console with your .conf file:wireguard /installtunnelservice C:\path\to\some\myconfname.confThis creates a service called WireGuardTunnel$myconfname, which can be controlled using standard Windows service management utilites, such as services.msc or sc.— sourceControl the service with "ServiceTray": give you a nice icon on the system tray that shows the up status of the WireGuard tunnel service. Green = connected, red = not connected, and you can
2025-04-22