Closed mbonino closed 2 years ago
Great! thank you!
Hi @mbonino - short question - where are you setting the friendly names in this use case? are they part of the netplan?
Hi @aa-matthias,
I don't use netplan, I use systemd-networkd to create Wireguard interfaces.
On my Ubuntu 20.04 server, I have create file /etc/systemd/network/20-wg0.netdev
File content:
[NetDev]
Name = wg0
Kind = wireguard
Description = WireGuard tunnel
[WireGuard]
ListenPort = 51860
PrivateKey = <privatekey>
[WireGuardPeer]
# friendly_name = admin
PublicKey = <blabla>
AllowedIPs = 192.168.1.2/32
AllowedIPs = 192.168.1.3/32
AllowedIPs = 192.168.1.4/32
AllowedIPs = 192.168.1.5/32
Thanks for the heads up!
I thought of using netplan and systemd-networkd as a renderer to have only one place for all network config but I assume it's not possible to create the # friendly_name = ....
property in this case
https://netplan.io/reference/#properties-for-device-type-tunnels%3A
I guess support for friendly_name
has to be added upstream.
Currently netplan
's parser for Wireguard
doesn't support friendly names as far as I can tell.
Hi people,
why not use the description
attribute that systemd-networkd already supports?
Hi @bastelfreak,
systemd-networkd support the description
attribute at [NetDev]
level. This means one attribute per interface.
A wireguard interface can have multiple peers, so we can't use it. Each peer needs its own attribute.
Systemd-networkd managed wireguard interfaces use
[WireGuardPeer]
rather than[Peer]
.Friendly names need a peer section in config file. This change allow using both wireguard config files and systemd-networkd config files.