<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hi Tom,</div><div class="gmail_default" style="font-family:verdana,sans-serif"> Yes I have a stable IP external address. Under normal circumstances it only changes if I change device (the MAC address) that requests the dhcp lease. Thus I only have to deal with roaming (changing IPs) on my client device(s) not the server. I have never heard of a ISP that changes an assigned IP address every 24 hours, its pretty unfriendly practice. Normally client devices request renewal of the specific IP address it was previously assigned, so your ISP is explicitly refusing to renew that and causing the client to request a new IP. I would be seeking a new ISP in your situation.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">David</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 6, 2019 at 3:17 AM <<a href="mailto:boerner@t-online.de">boerner@t-online.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:"Noto Sans";font-size:10pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">Hi David,</p>
<p style="margin:0px;text-indent:0px">Thanks for your elaborate answer!</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Yes, your assumption is right - my clients connect to a URL that resolves to an internal address when inside my local LAN. The idea was to keep traffic internal whenever possible. </p>
<p style="margin:0px;text-indent:0px">I have now followed your suggestion and have my VPN URL always resolved to the external IP address so the address won't change when leaving/entering the local network.</p>
<p style="margin:0px;text-indent:0px">For me, this solves a part of my issue but not all of it. </p>
<p style="margin:0px;text-indent:0px">My router is assigned a new external address (both IPv4 and IPv6) every 24 h, and obviously this invalidates the public IP adresses known by the server and the client simultaneously, as they are identical for the clients connected to the local network. That makes the handshake fail, and "wg" on the server shows that it is still looking for its endpoints at the old address. The same is true for the clients.</p>
<p style="margin:0px;text-indent:0px">Disconnecting/reconnecting the clients fixes the tunnel until the next address change, because then Wireguard looks for the DNS record instead of using its stored address information. I think it would be a good feature if Wireguard could refresh its endpoint addresses automatically when an endpoint is not reachable anymore.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">How does it work on your side? Have you a constant external IP address?</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Thomas</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Am Montag, 5. August 2019, 23:28:41 CEST schrieb David Kerr:<br></p>
<p style="margin:12px 40px 0px;text-indent:0px"><span style="font-family:"verdana,sans-serif"">I assume you have set the client configs to connect to something like "</span><a href="http://vpn.example.com" target="_blank"><span style="font-family:"verdana,sans-serif";text-decoration:underline;color:rgb(41,128,185)">vpn.example.com</span></a><span style="font-family:"verdana,sans-serif"">:<port>" . How does DNS resolve this when inside your local LAN? Does it resolve to the same public IP address that your DSL router is connected to, or does it resolve to an internal address like 192.168.1.1?</span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif"">The way I have this working is to ensure that my VPN URL always resolves to the external IP address, even when I am inside my home network. To do that I had to update my DNS server configuration to make sure that my VPN URL is always resolved by an external DNS provider... I have my own custom network gateway/router and set dnsmasq.static to include the line...</span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif"">server=/</span><a href="http://vpn.example.com/8.8.8.8" target="_blank"><span style="font-family:"verdana,sans-serif";text-decoration:underline;color:rgb(41,128,185)">vpn.example.com/8.8.8.8</span></a><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif"">Now this works for me because my wireguard server is running on my custom gateway/router... no NAT forwarding to an internal host running wireguard. If you are running wireguard on an internal server then you also need to make sure that your firewall rules don't block connections to your external interface from your local LAN and do the right NATing -- which is probably not permitted by default. I forget how to do this, but I'm sure google will find some instructions.</span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif"">David</span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span></p>
<p style="margin:0px 40px;text-indent:0px"><span style="font-family:"verdana,sans-serif""><br></span><br></p>
<p style="margin:0px 40px;text-indent:0px">On Mon, Aug 5, 2019 at 2:57 PM <<a href="mailto:boerner@t-online.de" target="_blank"><span style="text-decoration:underline;color:rgb(41,128,185)">boerner@t-online.de</span></a>> wrote:<br></p>
<p style="margin:0px 40px 0px 45px;text-indent:0px">Hey all,<br><br>I've recently set up my private VPN with Wireguard. I am running my local server behind a DSL router with a variable public IP address, accessible via dyndns and NAT, and several mobile clients (Android, Notebooks). <br>Everything is working fine so far, except of one issue that I would like discuss here: <br>Roaming doesn't work reliably when a device leaves or re-enters the home LAN, nor when the public IP address is changed by my ISP. The reason seems clear to me: In these cases both peers change their IP address simultaneously whereas the Wireguard protocol relies on only one address changing at a time.<br><br>My approach would be to shut down Wireguard on the clients as long as they are connected to their home network locally and to bring up the tunnel only when they leave the home network. Besides the roaming issue it would be desirable to use the local connection when it is available rather than to take the detour over the internet. And it should be done automatically so users need not remember to switch on/off VPN all the time.<br>My idea was to use Tasker to perform something like wg-quick up|down tun1 accordingly, but the Wireguard command line tools wg and wg-quick don't seem to be available (anymore). In older forum posts I've seen that you can install them from the app settings, but in my version (v0.0.20190708) this option is not available.<br><br>Does anybody know about another solution? Or, as a question to the developers, would it be a big deal to bring back the command line feature?<br><br>Thanks, Tom<br><br><br><br><br>_______________________________________________<br>WireGuard mailing list<br><a href="mailto:WireGuard@lists.zx2c4.com" target="_blank"><span style="text-decoration:underline;color:rgb(41,128,185)">WireGuard@lists.zx2c4.com</span></a><br><a href="https://lists.zx2c4.com/mailman/listinfo/wireguard" target="_blank"><span style="text-decoration:underline;color:rgb(41,128,185)">https://lists.zx2c4.com/mailman/listinfo/wireguard</span></a><br></p>
<p style="margin:0px;text-indent:0px"><br><br></p></div></blockquote></div>