manuels / wireguard-p2p

A tool for setting up WireGuard connections from peer to peer.
327 stars 24 forks source link

Looking for some docs #8

Open tjjh89017 opened 5 years ago

tjjh89017 commented 5 years ago

Hi, I'm very interested in this project. But I found less docs about the design. Could you tell us more about this? (master branch) Thanks a lot

manuels commented 5 years ago

Hi @tjjh89017, I am currently working on a new version (though it's just a hobby and I do not know when it's production ready, yet).

I'm not sure what you mean by design. The software roughly works like this:

tjjh89017 commented 5 years ago

So wg-p2p will act as a proxy between the wg port and really port?

If you are busy, plz ignore my questions. Thanks

manuels commented 5 years ago

Exactly, I could not find a design where this forwarding is not required. Though I might replace it with a eBPF program one day ;)

tjjh89017 commented 5 years ago

I'm not sure But maybe Bittorrent UDP hole punch will help?

manuels commented 5 years ago

Not sure how this should help. I use STUN for that.

tjjh89017 commented 5 years ago

Use hole punch, we can connect wireguard without proxy Let me think about it

tjjh89017 commented 5 years ago

@manuels I survey a lot for this topic I think BPF or eBPF will help this

I want to implement a similar approach using BPF or eBPF (new C++ or Golang project) (if you don't mind) Wireguard's example use a custom server to do the UDP hole punching. [1] This part may be replaced with STUN or TURN server to determine the port in use or relay the UDP traffic, and use OpenDHT or Mainline DHT to store the IP and port info.

  1. BPF or eBPF for avoiding use "proxy"
  2. TURN server for symmetric NAT

and i don't think "pubkey exchange" will be necessary. (if i'm wrong, please correct me)

[1] https://github.com/WireGuard/WireGuard/tree/master/contrib/examples/nat-hole-punching

afeiszli commented 4 years ago

Hi, I'm also interested in Docs. A simple readme with an example configuration would be enough. Just hard to use without any info.