Forums

Home Forums Troubleshooting Wireguard Disconnect several

Wireguard Disconnect several

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4962
    Ramazanpour69
    Participant

    Hi,

    I have several Wireguard acc from providers. all of them are ok on android and Windows. but when I set it up on router ( Xiaomi 4C with PCWRT ) It’s ok till we leave home for a work or anything or Sleep.. after that when we connect to router wifi or with lan wireguard did not working… need to Reboot the router or disconnect and reconnect from APPS/ Wireguard …

    I tested that on three xiaomi 4c with several Internet providers…..

    What can We do?

    #4963
    support
    Keymaster

    WireGuard on the router is a straight build of open source code. I think the disconnects overnight or after long idling depend on the server side and connectivity conditions. For now, just log in and restart the connection when that happens.

    That said, we’ll add a connection monitor in the next firmware update to mitigate this condition.

    #4982
    Ramazanpour69
    Participant

    Thank you for reply.
    is any file available for edit or how set a cronjob for restart wireguard connection every 6hrs?

    when next update will release?

    #5204
    Daarke01
    Participant

    The problem is related to NTP settings and especially the way the clock which drives the Wireguard drifts (since routers don’t have a RTC built-in).After a while, or when you have turned off the router for a day or two and try to reconnect, it becomes a problem..

    For your internet to work, Wireguard must work (since you’re tunneling WAN traffic through it).
    For Wireguard to work, it depends on a monolithic timestamp (meaning it must always go forward). If router has been powered off for a while, the date will be all sorts of wrong. And so, the NTP settings must correct this on startup.
    For NTP settings to work, you need internet to work (back on square 1).

    Some people have suggestion to manually set the time (2030-10-10 – 10.00 for example) during initial startup everytime you reboot. To trick WG, and then it will be set correctly when NTP syncs. And a cron job every hour or so to correct the drift. This has worked a while for me, but it always screws up sooner or later. Hopefully this can be better optimised or fixed.

    If it would be possible to route NTP through ISP internet (not VPN) and have it sync once in a while (like a watchdog timer). It would fix WireGuard.

    #5205
    Daarke01
    Participant

    Forgot to mention, my experience with Wireguard is only with OpenWRT routers. But i was having similar problems.
    If this problem is already migitated or fixed with PCWrt software, then i don’t wether or not it’s a server or client side of the problem that causing the issue.

    #5206
    support
    Keymaster

    @Daarke01 Thanks for the info. The pcWRT router does not have this problem. NTP communication is always sent through the ISP connection.

    Also, a WireGuard connection monitor has been added to re-establish the connection if the connection is lost for whatever reason. C.f., https://www.pcwrt.com/forums/topic/pcwrt-firmware-v2-4-6-release-notes/

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.