Hi HN,
For the past few months, I've been exploring tools that integrate with the Linux networking stack. This led me to build SafeHaven, a lightweight and configurable VPN implementation written in Go. The goal was to better understand how virtual private networks work at a fundamental level.
Would love feedback from the community! Repo link: https://github.com/kwakubiney/safehaven
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...