4 ms·
Does the actual traffic goes through the gateway or the gateway is only used for setting up the connection?
by tmd83 2y ago
Does the actual traffic goes through the gateway or the gateway is only used for setting up the connection?
- wh33zle 2y agoYes, traffic is routed to the gateway through a WireGuard tunnel. Broadly speaking, what happens is: - Client and gateway perform ICE to agree on a socket pair (this is where hole-punching happens or if that fails, a relay is used) - The socket pair determined by ICE is used to set up a WireGuard tunnel (i.e. a noise handshake using ephemeral keys). - IP traffic is read from the TUN device and sent via the WireGuard tunnel to the gateway. - Gateway decrypts it and emits it as a packet from its TUN device, thereby forwarding it to the actual destination. It is worth noting that a WireGuard tunnel in this case is "just" the Noise Protocol [0] layered on top of UDP. This ensures the traffic is end-to-end encrypted. [0]: https://noiseprotocol.org https://noiseprotocol.org