From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: smntov@gmail.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id ed431462 for ; Sun, 25 Mar 2018 17:58:55 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 408f5d18 for ; Sun, 25 Mar 2018 17:58:55 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id t7so11492580wmh.5 for ; Sun, 25 Mar 2018 11:10:42 -0700 (PDT) Return-Path: Message-ID: <1522001437.2044.11.camel@gmail.com> Subject: Re: add/remove a peer From: ST To: Wang Jian Date: Sun, 25 Mar 2018 21:10:37 +0300 In-Reply-To: References: <1521919967.1921.32.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: WireGuard mailing list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2018-03-26 at 00:43 +0800, Wang Jian wrote: > 2018-03-25 3:32 GMT+08:00 ST : > > Hello, > > > > I'm learning WireGuard and have a question regarding adding/removing a > > peer. > > > > Is there something like: > > > > 1) wg add peer ABCDEF... allowed-ips 192.168.88.0/24 endpoint > > 209.202.254.14:8172 > > > > > > 2) similar for removing clients: > > > > wg rm peer ABCDEF... > > or > > wg rm peer allowed-ips 192.168.88.4/32 > > > > Is this implemented already or should I file it as a feature request > > somewhere? (if so - where?) > > > > You should already read man pages (man wg). > > for adding peer > # wg set wg0 peer peer_pubkey allowed-ips 192.168.88.4/32 endpoint > 209.202.254.14:8172 I want a WG (server) to assign an IP to a peer *automatically* if allowed-ips is not provided when running `wg set wg0 peer`. And then output it to STDOUT, so it can be passed to the peer (client). The same can be done if peer's public key is not provided. This would make addition of new peers(clients) much more easy - both for sysadmins and for non-tech-savvy clients (the latter will get a ready made wg0.conf file that they need to save to /etc/wireguard/ and all they need to do is `wg-quick up wg0`. That's it.) I don't think it is implemented... Mr. Donenfeld - would this qualify as a feature request? Thank you! PS: if you have over 100 peers it is a bit a headache to find a free IP when adding a new peer. There is no reason WG could not scan through IPs it already knows and choose a free one, assign it in its own config file and print it out for passing to the remote peer...