Score:0

Is this a bad way to avoid host isolation with WireGuard?

pe flag

Background

I am adding support for WireGuard VPN to an embedded device. The user will be able to set the AllowedIPs configuration themselves. WireGuard uses the allowed IPs to set routes on the host, so it will be possible for a user to isolate the device (make it impossible to connect via TCP). I have been thinking about ways to prevent this.

Potential Solution

One potential solution is to add IP rules for the host interfaces, such that any traffic with the source IP of an interface is always routed via that interface. If we had one host interface eth0 with IP 172.17.0.2 and one wireguard interface wg0 with IP 172.22.0.4 the configuration would look something like this:

ip route add default via 172.17.0.1 dev eth0 table 1    
ip rule add from 172.17.0.2 table 1

This means that connections originating from the device should still be routed normally but if someone connects to the device using TCP - for HTTP or ssh - the responses should be routed back.

Questions

On the surface this looks like a really elegant solution, but I can't help thinking that this isn't the default for a good reason. I just have not thought of what that reason could be. Is this a bad idea? Will it add a potential vulnerability to the device or something similar? Is there a better way to achieve my desired goal of avoiding device isolation?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.