Dynamic Adresses

Lonnie Abelbeck lists at lonnie.abelbeck.com
Wed Nov 29 15:25:05 CET 2017


On Nov 29, 2017, at 7:44 AM, Georg Faerber <georg at riseup.net> wrote:

> On 17-11-29 14:40:25, Jason A. Donenfeld wrote:
>> On Wed, Nov 29, 2017 at 2:35 PM, Mytril <mytril42 at posteo.de> wrote:
>>> Yes i have written a similar script for the german ubuntuusers.de wiki.
>> 
>> Care to share?
> 

In this season of sharing :-) last week I took Jason's reresolve-dns script as a reference and created a persistent background script "wireguard-monitor" that is started/stopped along side wireguard in our AstLinux project.

wireguard-monitor
https://github.com/astlinux-project/astlinux/blob/master/package/wireguard/wireguard-monitor

Currently wireguard-monitor only updates DNS endpoints when WIREGUARD_DNS_UPDATE="yes" in the sourced /etc/rc.conf file.  wireguard-monitor can be stopped by deleting the PIDFILE.

One minor improvement over Jason's example is only DNS endpoints are updated, I test for manual IPv4/IPv6 addresses.  I also wrote it hoping someday [Peer-peername] will be a valid config syntax.

Note, there are several things specific to our project, such as we create /var/lock/wireguard.lock when wireguard is active, and we include /usr/lib/bash/sleep as a bash builtin, but there might be a few ideas to take away.

Lonnie



More information about the WireGuard mailing list