Maybe instead of an external file, why not add an option like 
Alias/Nick/Displayname/Peername?
This would have the benefit of keeping the public key in display.

For the get going you might use (GNU) sed or similar to achieve this feature.
Create a file peernames as follows:

  s|<BASE64>|my nice peername|
  s|<BASE64>|my other peername|

and pipe wg through sed:
  wg | sed -f peernames

Of course you can get more creative. Maybe keep the public key there.
I'm not sure how to keep the colouring though.

PS:
I'm not sure if BSDs or others SED support changing / in substitutions.

On Fri, Jan 24, 2020 at 05:01:49PM +0100, jens 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?

thx for answers.
fuzzle

--
make the world nicer, please use PGP encryption


_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

Reply via email to