BTW: You can also use the netlink library to configure the routing table without external processes[2]. The /1 trick isn't necessary either, you can just create a route for 0.0.0.0/0 and set its metric lower than the existing default route. That won't replace the old route in the table, the new one will just take precedence as long as it exists.
[1] https://github.com/hyprspace/hyprspace
[2] https://github.com/hyprspace/hyprspace/blob/a5957e485ff0c2e9...
My goal there was to have as little code as possible so that one could look at it and immediately grasp what goes into establishing a VPN.
[1]https://github.com/dsnet/udptunnel [2]https://www.amazon.com/Internet-Security-Hands-Approach-Comp...
I believe wireguard runs over UDP and while you still need a TUN device, it has kernel implementations to handle encrypting the traffic.
> Currently, packets are not being encrypted within the UDP tunnel so packet sniffing over the internet is possible. It is encouraged to use this over a protocol like SSH
No encryption takes the P out of VPN. Also, if you are going to need SSH to make it secure, then you can just use OpenSSH's built-in support for the tun device using the -w option.