Skip to contentSkip to conversation

Adding comments for a peer through wg set

DISCUSSION Sukhbir Singh 2 participants 2 messages Mar 17, 2020 – Mar 30, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

When adding a new peer through wg set', it seems like there is no way to include comments in the parameters. To solve this, the hack I use involves making sure SaveConfig is set in wg0.conf, adding the peer, wg-quick save' and then appending the desired comment to the end of the wg0.conf file. This helps me add the peer without taking down the tunnel and also saves it to the config.

Is there a better way? Note that I tried adding the comments to the different parameters (using "#") but it didn't work as expected.

What's the reason for adding comments? So as to keep some notes about the peer I added, like "[Peer] ... # laptop config". So if there is a better solution for key management, please do share.

Thanks.

Signature · 1 line
Sukhbir
#1 lore raw
Quoted 13 lines · Sukhbir Singh

Hi,

When adding a new peer through wg set', it seems like there is no way to include comments in the parameters. To solve this, the hack I use involves making sure SaveConfig is set in wg0.conf, adding the peer, wg-quick save' and then appending the desired comment to the end of the wg0.conf file. This helps me add the peer without taking down the tunnel and also saves it to the config.

Quoted 6 lines

Is there a better way? Note that I tried adding the comments to the different parameters (using "#") but it didn't work as expected.

What's the reason for adding comments? So as to keep some notes about the peer I added, like "[Peer] ... # laptop config". So if there is a better solution for key management, please do share.

My solution to this problem is to maintain my own files and generate the server wg0.conf from them. I also generate the clients wg0.conf from the same data. I manage the allocation of IP addresses automatically.

Then the things that you are using comments for can be key/value pairs in thoses files. For example I have a friendly name for each peer.

Barry

Quoted 6 lines

Thanks.

Signature · 1 line
Sukhbir