Wireguard with dynamic IPs and mobile devices?

I’d like to install Wireguard on my phones/laptops. It seems to be the most lightweight and performant VPN option for that application.

However, as I understand it, by itself Wireguard doesn’t support dynamic IPs that change frequently very well (since you have to relaunch the mobile client to re-resolve a domain nam every time the peer’s IP changes).

How have your guys’ experiences been using a router with a dynamic public IP as the “server” and using with mobile devices like phones/tablets?

My brief guess is to use iptables to map the dynamic IP interface to a static local wireguard ipv4 address but I may be wrong

ugh wait a minute yeah I’m wrong

I feel like there’s a simple solution I’ll get back to you

That won’t work when the device doesn’t have a static public IP address… You can configure WG to use a domain that points to a dynamic IP, and use DDNS to keep them up to date, but when the IP changes, you have to re-launch WG to re-resolve the domain.

1 Like

Have you tried enabling continuous resolve on the client?It auto attempts to reconnect when the connection drops

Tailscale is the answer tbh. There are other ways to deal with it but Tailscale would be the easiest.

2 Likes

It sounds like you just want tailscale

Seriously, try auto-tunneling on the WG client. It’s beta but I think that’s why that option is there.

Tailscale looks promising but personally I don’t like the lack of control

There is a self-hosted option for Tailscale called headscale.

1 Like