wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Jake McGinty <me@jake.su>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Cc: notrhodey@protonmail.com
Subject: wg-dark: a tiny toy darknet
Date: Mon, 3 Sep 2018 23:08:48 +0000	[thread overview]
Message-ID: <b896d1df-5f5a-5044-b4f9-5183851aaa43@jake.su> (raw)

I thought I'd share a toy darknet to the list. It's p2p, but with a
coordinating server to deal with addressing and NAT holepunching.

The client is 134 lines of cross-platform bash. The coordinating server
is an additional ~175 lines of node.

repo: https://github.com/wg-dark/wg-dark


# How it works

A coordinating server is at an external address (ex. cool.dark.net) and
a fixed internal wg address (10.13.37.1). It handles 1) invites,
2) address assignment, and 3) peer announcements / NAT holepunching.

1) Any existing darknet peer GETs http://10.13.37.1:1337/invite, and
receives something like
"cool.dark.net:1337:6e435b7a2541b7443adebec9754fae9d". They give it to
an Invitee.

1) Invitee POSTs https://cool.dark.net:1337/join and sends its invite
code and a generated wg pubkey.

2) Server sends back an assigned address (ex. 10.13.37.2/32) and the
server's pubkey.

3) Invitee adds the server as a peer to a new wg interface.

4) Invitee GETs http://10.13.37.1:1337/status and receives a wireguard
configuration list of all peers with their latest endpoints.

5) Peers periodically repeats the status request to update their peer lists.

That's about it. It's incredibly feature-limited, quick, dirty, and has
infinite room for improvement.


<< Not for use for anything other than funsies. >>

                 reply	other threads:[~2018-09-03 22:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b896d1df-5f5a-5044-b4f9-5183851aaa43@jake.su \
    --to=me@jake.su \
    --cc=notrhodey@protonmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).