OPNsense Forum

English Forums => Virtual private networks => Topic started by: mater on February 03, 2021, 12:27:50 PM

Title: wireguard with endpoint that changes IP daily
Post by: mater on February 03, 2021, 12:27:50 PM
Hi,
i have the situation that I have to run an Site to Site VPN over wireguard, with one endpoint that changes its IP daily.
I can define the time of day when this can happen, but it must happen every 24h (it's defined by the ISP)

The other endpoint changes their IP only, when the cablemodem gets reset, so maybe once a year or so.

Now I'm using dyndns to get the IPs of the endpoints.
When the wireguard connection is running, it doesn't detect the IP Change.

So I thought, I could restart the wireguard connection once a day with a cronjob. Or ist there a better solution?
Title: Re: wireguard with endpoint that changes IP daily
Post by: chemlud on February 03, 2021, 01:34:31 PM
Not that I'm aware of....
Title: Re: wireguard with endpoint that changes IP daily
Post by: mater on February 03, 2021, 06:08:54 PM
Ok, thank you
Title: Re: wireguard with endpoint that changes IP daily
Post by: mnaim on February 04, 2021, 02:21:06 PM
wireguard can work in mode when one side has dynamic address, just dont fill it at all.
Im using that setup with no problem...eg. mobile phone, laptop etc. connecting to vpn
Title: Re: wireguard with endpoint that changes IP daily
Post by: mater on February 06, 2021, 12:46:13 PM
@mnaim
This VPN is a Site 2 Site VPN.
Both Sites must have access to each other.

What you talking about is a road warrior setup, as far as I know.


I have an other idea for a solution.
I try to use this script in opnsense: https://wiki.archlinux.org/index.php/WireGuard#Endpoint_with_changing_IP (https://wiki.archlinux.org/index.php/WireGuard#Endpoint_with_changing_IP)