Development discussion of WireGuard
 help / color / mirror / Atom feed
* Best practices for adding hosts
@ 2020-12-20 23:09 Ronan Lucio
  2020-12-21  0:24 ` Reto
       [not found] ` <9B2F58B7-92A3-425E-9B28-DF715B5B5503@tomcsanyi.net>
  0 siblings, 2 replies; 5+ messages in thread
From: Ronan Lucio @ 2020-12-20 23:09 UTC (permalink / raw)
  To: WireGuard mailing list

Hi,

I have a wireguard VPN server, and it's working gracefully, thanks for that.
I'd like to ask you how can I add more peers without having to restart wg.

So far I use to add new peers to the "wg0.conf" file and execute a
"systemctl restart wg-quick@wg0".
The problem is all peers go down when I do it, and there's no
"systemctl reload" option.

If possible, I'd like to keep all configs on config files, so it's
possible to automate configuration via ansible.

Thanks,
Ronan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best practices for adding hosts
  2020-12-20 23:09 Best practices for adding hosts Ronan Lucio
@ 2020-12-21  0:24 ` Reto
       [not found] ` <9B2F58B7-92A3-425E-9B28-DF715B5B5503@tomcsanyi.net>
  1 sibling, 0 replies; 5+ messages in thread
From: Reto @ 2020-12-21  0:24 UTC (permalink / raw)
  To: Ronan Lucio; +Cc: WireGuard mailing list

On Mon, Dec 21, 2020 at 12:09:40PM +1300, Ronan Lucio wrote:
> I have a wireguard VPN server, and it's working gracefully, thanks for that.
> I'd like to ask you how can I add more peers without having to restart wg.

`man wg`... set / setconf / addconf depending on your specific usecase.

Also, `man wg-quick`

```
The strip command is useful for reloading configuration files without disrupting active sessions:
# wg syncconf wgnet0 <(wg-quick strip wgnet0)
```

As well as: https://git.zx2c4.com/wireguard-tools/commit/?id=a66219fa107e1bf0a03ebbbc405879c1f0a826c5


Cheers,
Reto

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best practices for adding hosts
       [not found] ` <9B2F58B7-92A3-425E-9B28-DF715B5B5503@tomcsanyi.net>
@ 2020-12-21  0:51   ` Ronan Lucio
       [not found]     ` <K12715-4.1608513012@spamhaus.org>
  2020-12-25  6:43     ` Adrian Ho
  0 siblings, 2 replies; 5+ messages in thread
From: Ronan Lucio @ 2020-12-21  0:51 UTC (permalink / raw)
  To: WireGuard mailing list

Hi Domi,

Right, it's not on the latest version. Actually, I used to run the
system version, so I can set it to automate unattended-updated.
Anyway, no problem updating it... ;-)

I tried executing it manually and got this:

    $ sudo wg syncconf wg0 <(exec /usr/bin/wg-quick strip wg0)>
    -bash: syntax error near unexpected token `newline'

Any clue?

Thank you,
Ronan

On Mon, Dec 21, 2020 at 1:01 PM Tomcsanyi, Domonkos <domi@tomcsanyi.net> wrote:
>
> Hi Ronan,
>
> There should be a reload option, check the changelog from August this year:
>
> https://lists.zx2c4.com/pipermail/wireguard/2020-August/005780.html
>
> Maybe you are not running the latest version? In that case just take the command from the patch and run it manually.
>
> Kind regards,
> Domi
>
>
> 21.12.2020 dátummal, 0:11 időpontban Ronan Lucio <ronanlucio@gmail.com> írta:
>
> Hi,
>
> I have a wireguard VPN server, and it's working gracefully, thanks for that.
> I'd like to ask you how can I add more peers without having to restart wg.
>
> So far I use to add new peers to the "wg0.conf" file and execute a
> "systemctl restart wg-quick@wg0".
> The problem is all peers go down when I do it, and there's no
> "systemctl reload" option.
>
> If possible, I'd like to keep all configs on config files, so it's
> possible to automate configuration via ansible.
>
> Thanks,
> Ronan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best practices for adding hosts
       [not found]     ` <K12715-4.1608513012@spamhaus.org>
@ 2020-12-21  1:55       ` Ronan Lucio
  0 siblings, 0 replies; 5+ messages in thread
From: Ronan Lucio @ 2020-12-21  1:55 UTC (permalink / raw)
  To: WireGuard mailing list

Hi Andrew,

> /usr/bin/wg syncconf wg0 <(wg-quick strip wg0)

worked smoothly
Thank you so much

Ronan

On Mon, Dec 21, 2020 at 2:10 PM Andrew Fried <afried@spamteq.com> wrote:
>
> Try running the command under bash, eg:
>
> #!/bin/bash
> /usr/bin/wg syncconf wg0 <(wg-quick strip wg0)
>
> Andrew
>
> On 12/20/20 7:51 PM, Ronan Lucio wrote:
>
> Hi Domi,
>
> Right, it's not on the latest version. Actually, I used to run the
> system version, so I can set it to automate unattended-updated.
> Anyway, no problem updating it... ;-)
>
> I tried executing it manually and got this:
>
>     $ sudo wg syncconf wg0 <(exec /usr/bin/wg-quick strip wg0)>
>     -bash: syntax error near unexpected token `newline'
>
> Any clue?
>
> Thank you,
> Ronan
>
> On Mon, Dec 21, 2020 at 1:01 PM Tomcsanyi, Domonkos <domi@tomcsanyi.net> wrote:
>
> Hi Ronan,
>
> There should be a reload option, check the changelog from August this year:
>
> https://lists.zx2c4.com/pipermail/wireguard/2020-August/005780.html
>
> Maybe you are not running the latest version? In that case just take the command from the patch and run it manually.
>
> Kind regards,
> Domi
>
>
> 21.12.2020 dátummal, 0:11 időpontban Ronan Lucio <ronanlucio@gmail.com> írta:
>
> Hi,
>
> I have a wireguard VPN server, and it's working gracefully, thanks for that.
> I'd like to ask you how can I add more peers without having to restart wg.
>
> So far I use to add new peers to the "wg0.conf" file and execute a
> "systemctl restart wg-quick@wg0".
> The problem is all peers go down when I do it, and there's no
> "systemctl reload" option.
>
> If possible, I'd like to keep all configs on config files, so it's
> possible to automate configuration via ansible.
>
> Thanks,
> Ronan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Best practices for adding hosts
  2020-12-21  0:51   ` Ronan Lucio
       [not found]     ` <K12715-4.1608513012@spamhaus.org>
@ 2020-12-25  6:43     ` Adrian Ho
  1 sibling, 0 replies; 5+ messages in thread
From: Adrian Ho @ 2020-12-25  6:43 UTC (permalink / raw)
  To: wireguard

On 21/12/20 8:51 am, Ronan Lucio wrote:
> I tried executing it manually and got this:
>
>      $ sudo wg syncconf wg0 <(exec /usr/bin/wg-quick strip wg0)>
>      -bash: syntax error near unexpected token `newline'

Your command:

sudo wg syncconf wg0 <(exec /usr/bin/wg-quick strip wg0)>

has an output redirection character ('>') at the end, so bash was 
expecting a filename after that, but got a newline instead.

Best Regards,
Adrian


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-25 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-20 23:09 Best practices for adding hosts Ronan Lucio
2020-12-21  0:24 ` Reto
     [not found] ` <9B2F58B7-92A3-425E-9B28-DF715B5B5503@tomcsanyi.net>
2020-12-21  0:51   ` Ronan Lucio
     [not found]     ` <K12715-4.1608513012@spamhaus.org>
2020-12-21  1:55       ` Ronan Lucio
2020-12-25  6:43     ` Adrian Ho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).