wireguard-hosts file

Barry Scott barry at barrys-emacs.org
Mon Jan 27 22:45:20 CET 2020

> On 24 Jan 2020, at 16:01, jens <jens at viisauksena.de> wrote:
> i really would love to have a feature like wireguard-hosts file.
> whereas wg command would print given "name" instead of key - so the
> output would be more meaningfull
> We have some wireguard running in server like infrastructure, where one
> server serves dozens of "clients"
> so instead of
> peer: l9FxaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaU=
> we would have something alike
> peer: superhero downtown
> some of you may be familar with batman-adv layer2 routing protocol,
> there they also have a batctl which is working pretty similar to wg tool.
> there you can add a bat-hosts file which is doing the job, which totaly
> works likes any hosts file
> a normal hosts file maps ip to name,
> a bat-hosts file maps mac addresses to name,
> a wg-hosts file would map keys to name.
> i found the sources for bat-hosts ( .c .h .sample ) here
> https://downloads.open-mesh.org/batman/releases/batman-adv-2019.5/batctl-2019.5.tar.gz
> is this something maybe usefull to other also?
> is there a chance to have this implemented by default?

I thought about this problem as well. I was thinking along the lines
of having a user-defined string field that could be used as the
friendly client name instead of the client public key.

But since I concluded that I needed my own tooling on top of
what wireguard provides at the server end. At that point
I can replace the wg command with my own that does what
I want.

I use the client public key as the key into my client database.

I have a python script that added clients to the database,
generates a new server wg0.conf and a wg0.conf for each client.
It takes care of allocating the next free IP address in the VPN pool
for example.

Another python script takes the output of "wg show wg0 dump" and
the database to create a status output that uses the client names.


> thx for answers.
> fuzzle
> -- 
> make the world nicer, please use PGP encryption
> <0x507EB93F6F6DEE01.asc>_______________________________________________
> WireGuard mailing list
> WireGuard at lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard

More information about the WireGuard mailing list