wireguard-p2p
wireguard-p2p copied to clipboard
Looking for some docs
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
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:
- open a UDP socket and run STUN over the socket to determine it's public ip and port.
- publish this public ip and port encrypted in OpenDHT.
- lookup the other peer's public ip and port in OpenDHT.
- try to connect to the other peer using this UDP socket.
- open a local UDP socket and connect to the local wireguard port.
- forward all packets between these two UDP sockets.
So wg-p2p will act as a proxy between the wg port and really port?
If you are busy, plz ignore my questions. Thanks
Exactly, I could not find a design where this forwarding is not required. Though I might replace it with a eBPF program one day ;)
I'm not sure But maybe Bittorrent UDP hole punch will help?
Not sure how this should help. I use STUN for that.
Use hole punch, we can connect wireguard without proxy Let me think about it
@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.
- BPF or eBPF for avoiding use "proxy"
- 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
Hi, I'm also interested in Docs. A simple readme with an example configuration would be enough. Just hard to use without any info.