Multiple peers to one wireguard "server"

Jason A. Donenfeld Jason at zx2c4.com
Mon May 29 22:54:10 CEST 2017


Hi Ibrahim,

On Mon, May 29, 2017 at 10:31 PM, Ibrahim Tachijian <barhom at netsat.se> wrote:
> If I understand correctly if I need to connect 10 different wg "clients" to
> one wg "server" I will require one wgX interface per-client on the "server".
>
> Is this correct? Does this mean also that each wgX interface on the "server"
> needs to listen on its own UDP port or can the "server" reuse the same UDP
> port?

No. Each WireGuard interface may have multiple peers:

           [Interface]
           PrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk=
           ListenPort = 51820

           [Peer]
           PublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg=
           Endpoint = 192.95.5.67:1234
           AllowedIPs = 10.192.122.3/32, 10.192.124.1/24

           [Peer]
           PublicKey = TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0=
           Endpoint = [2607:5300:60:6b0::c05f:543]:2468
           AllowedIPs = 10.192.122.4/32, 192.168.0.0/16

           [Peer]
           PublicKey = gN65BkIKy1eCE9pP1wdc8ROUtkHLF2PfAqYdyYBz6EA=
           Endpoint = test.wireguard.io:18981
           AllowedIPs = 10.10.10.230/32

Please see the man page wg(8) or the front page of the website --
www.wireguard.io -- for more details.

Regards,
Jason


More information about the WireGuard mailing list