News for hackers. Stuff that matters.
Re:Why Not WireGuard by tssva on Monday March 16, 2020 @11:29PM (#22601332)
Although the article is confused regarding dynamic IP addresses your solution of identifying the endpoint using a DNS name is also not a complete solution when using Wireguard. The Wireguard tool, wg, resolves the DNS name and then sets the ip address for the endpoint which the wireguard protocol implementation then uses. Since the wireguard protocol implementation doesn't do any DNS resolution if the endpoint address changes even if the DNS record is updated wireguard will never know. Instead another tool needs to check the DNS record of the endpoint periodically either at some fixed interval and/or based upon the TTL of the DNS record. If the record changes it then needs to update the configuration of the wireguard protocol implementation.
Re:Why Not WireGuard by cyphar on Monday March 16, 2020 @11:56PM (#22601496)
This is not always required. WireGuard peers can roam freely very similarly to Mosh (if one peer receives an authenticated message from one of its peers from a different IP address, it will update the gateway of that peer and will send all subsequent packets to that IP address).

But to be fair, this doesn't work perfectly (especially if you have certain firewall rules that block UDP packets if they're not part of the what the firewall thinks is the same "connection", if both peers change their IP at the same time, or if the peer whose IP changed was rebooted or reconfigured before the other peer received a packet from its new IP addreds) but it really does work surprisingly well. For those (important) corner-cases, I would imagine that higher-level tooling such as NetworkManager would do the DNS checks you're talking about.

Re:Why Not WireGuard by jcrawfordor on Tuesday March 17, 2020 @12:22AM (#22601637)
Right, the free roaming tends to be on "the other side" though. This is a bit confusing to talk about because Wireguard does not have a concept of "client" and "server" and either side can nominally initiate the tunnel. However, in roaming configurations, typically only one side will have the information to initiate the connection (endpoint) and so there's a tendency to call this the "client."

The non-roaming end (end with a known endpoint) will update the IP of the roaming end every time a handshake occurs. The issue the OP is getting at though is when both ends are roaming. In this case the, er, "more roaming" peer needs some way to find the other peer. There are a lot of technically interesting ways that we could solve this problem, but in practice it's pretty much always solved by dynamically updating a DNS record. I would say Wireguard handles this scenario about as well as anything else (maybe a little worse, see sibling comment).

Another approach would be using a "meet-me" relay with a fixed IP, such as TURN. This also has the advantage of handling NAT on both sides (which would be a common issue with a roaming-to-roaming situation). I can't think of any reason it's impossible to run Wireguard through TURN but I can't find any examples of anyone doing so, likely in part because the TURN client is usually embedded in the application and is a bit complicated. Still, might be a hobby project to implement it for Wireguard.

Re:Why Not WireGuard by jcrawfordor on Tuesday March 17, 2020 @12:13AM (#22601580)
This is an issue, but in typical dynamic IP situations the IP tends to only change when there's some sort of disruption that prevents renewal and not very frequently (e.g. I've held a Comcast consumer IP for over a year before), which tends to mitigate this effect since the IP changing "out from underneath" the tunnel won't occur. Most dynamic DNS schemes, with DNS caching added on top, also tend to result in pretty long (hour +) delays on IP updates to DNS which further make this a bit of a non-issue.

That said, I do believe both IPv6 and OpenVPN will have this exact same problem - IP change will not be reflected until something forces setup to repeat. The difference would be that these, at least I do believe, will re-resolve on retries. Wireguard doesn't really have a sense of "retrying the connection" which makes it sort of philosophically difficult for it to do so.

Re:Why Not WireGuard by izacus on Tuesday March 17, 2020 @04:42AM (#22602946)
One very common scenario where WireGuard fails - you have a WG persistent VPN enabled and you actually move into the network that has the VPN endpoint. The IP of WG endpoint changes from a public one to a local one.
Re:Why Not WireGuard by vetinari on Tuesday March 17, 2020 @12:20PM (#22606501)
This keeps happening to me all the time, and it is no problem.

Once I move into the network that has the respective VPN endpoint, the subnets that are routable via wg become routable via ethernet/wifi which have higher priority, so the traffic will go directly.

Re:Why Not WireGuard by kotharia on Tuesday March 17, 2020 @04:57AM (#22603023)
I don't have this problem. If the endpoint is accessible through the public address even in the internal network then everything just works.
Re:Why Not WireGuard by loeg on Tuesday March 17, 2020 @02:10AM (#22602216)