# Wireguard problem with resolving peer

**URL:** <https://forum.openwrt.org/t/wireguard-problem-with-resolving-peer/40830>\
**Category:** Installing and Using OpenWrt\
**Created:** [July 16, 2019, 10:26am UTC](https://forum.openwrt.org/t/wireguard-problem-with-resolving-peer/40830 "2019-07-16T10:26:47Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![takimata](https://forum.openwrt.org/user_avatar/forum.openwrt.org/takimata/32/114647_2.png) [@takimata](https://forum.openwrt.org/u/takimata)\
**Post date:** [July 16, 2019, 12:59pm UTC](https://forum.openwrt.org/t/wireguard-problem-with-resolving-peer/40830/3 "2019-07-16T12:59:41Z")

</div>

There is a "wireguard-watchdog" script exactly for that purpose. It is part of wireguard-tools, [usage is described in the commit message](https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=20c4819c7baf6f9b91420849caf30e5137bd75d6).

Called via a cronjob (documentation recommends every minute) it checks all wireguard connections for their last handshake, and if it is more than 150 seconds in the past, re-initializes the respective connection ... which also includes a new lookup. (And I can personally attest that it works perfectly.)

> [@trendy](#):
>
> > [@](#):
> >
> > you may want to use a `PostUp` hook to restart Wireguard every few minutes or hours

While this would work, it is a rather blunt instrument, interrupting _all_ Wireguard connections _even if they are perfectly fine and currently transferring data_. "Every few minutes" is an especially curious suggestion that would result in one never being able to hold a download for more than a few minutes.

---

_[View the full topic](https://forum.openwrt.org/t/wireguard-problem-with-resolving-peer/40830)._
