micahmo / WgServerforWindows

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

NAT Routing - Doesn't start automatically (task not being created) #75

Closed ualdayan closed 1 year ago

ualdayan commented 1 year ago

I have v2.0.5 and it works great except for after the computer restarts. NAT Routing always stays disabled until I start up WS4W and click enable again. I don't see anything under services about starting up automatically - what would the command be to start NAT routing so that I could add it in manually as an Automatic (Delayed) start service?

micahmo commented 1 year ago

Hey @ualdayan, your issue sounds similar to #28 where the given adapter is not quite ready to handle a NAT routing network immediately upon boot. There is already a feature that attempts to automatically re-enable NAT, which is controlled by a Windows Task, but the timing may not work for every scenario. Fortunately, you can tweak it manually or simply create your own.

If you just want to enable/disable the Task from the WS4W, you can do so from the dropdown button next to Disable NAT.

image

From Task Scheduler, you can look for a Task with the name WS4W Set NetIPAddress (1048541f-d027-4a97-842d-ca331c3d03a9). From there you can do whatever you want (add a delay, etc.). Or copy the command and create your own task. The command simply invokes the WS4W CLI as such.

ws4w.exe setnetipaddress --serverdatapath C:\Users\micah\AppData\Roaming\WS4W\server_data\wg_server.conf

Hope that helps!

micahmo commented 1 year ago

Hey @ualdayan, version 2.0.9 adds the ability to define a custom delay for the Windows boot tasks. I hope that plus the command I provided earlier solves your issue.