OPNsense Forum

English Forums => General Discussion => Topic started by: bigr4232 on November 14, 2023, 07:24:55 AM

Title: Wireguard plugin not connecting after IP change
Post by: bigr4232 on November 14, 2023, 07:24:55 AM
I had the Wireguard plugin setup and ever since my external IP changed I have been unable to connect to my VPN. I changed the endpoint in my config but still nothing. This is happening on every device I have tried it on regardless on if it was connected to the same network or connected to a hotspot on another network. I am getting "Handshake did not complete" errors. Has anyone had issues with this and fixed it?

OPNsense version: 23.7.8_1
os-wireguard version: os-wireguard


edit: Just to add the the ip change is what I thought could have caused it. I haven't used my VPN in a bit so it could have been caused by something else.
Title: Re: Wireguard plugin not connecting after IP change
Post by: CJ on November 14, 2023, 06:11:26 PM
You should set up some sort of dynamic dns so you don't need to worry about your IP changing.

What do your client logs show?  Did you click apply after making your WG changes?
Title: Re: Wireguard plugin not connecting after IP change
Post by: bigr4232 on November 14, 2023, 09:02:34 PM
Yeah makes sense. I will set up dynamic dns once I get this working again. Here are the logs
Title: Re: Wireguard plugin not connecting after IP change
Post by: CJ on November 17, 2023, 05:56:20 PM
Why is your client sending so many handshakes?  It looks like the tunnel comes up and then it keeps trying to start a new one.

What do the OPNSense logs show?
Title: Re: Wireguard plugin not connecting after IP change
Post by: bigr4232 on November 18, 2023, 07:47:02 AM
Here are my opnsense wireguard logs
Title: Re: Wireguard plugin not connecting after IP change
Post by: CJ on November 18, 2023, 03:08:02 PM
Quote from: bigr4232 on November 18, 2023, 07:47:02 AM
Here are my opnsense wireguard logs

What do they show if you change the level to Debug?
Title: Re: Wireguard plugin not connecting after IP change
Post by: bigr4232 on November 18, 2023, 07:59:45 PM
Here are the debug logs. There is nothing in them.
Title: Re: Wireguard plugin not connecting after IP change
Post by: CJ on November 22, 2023, 08:54:28 PM
Quote from: bigr4232 on November 14, 2023, 09:02:34 PM
Yeah makes sense. I will set up dynamic dns once I get this working again. Here are the logs

I still keep coming back to this.  It's very odd.  Are the logs the same on all of your devices?
Title: Re: Wireguard plugin not connecting after IP change
Post by: bigr4232 on November 24, 2023, 03:05:02 AM
Yes they are the same on every device I have tested.
Title: Re: Wireguard plugin not connecting after IP change
Post by: CJ on November 26, 2023, 06:08:52 PM
You can try doing a packet capture but you're probably better off just restarting from scratch with a dynamic domain as that's where you want to eventually end up.
Title: Re: Wireguard plugin not connecting after IP change
Post by: meyergru on November 26, 2023, 08:03:36 PM
Plus, you have to consider that "far" side of the wireguard tunnel does not try to use the updated DNS entry, it just keeps trying the old IP unless you use the provided check/restart cron job there.
Title: Re: Wireguard plugin not connecting after IP change
Post by: bigr4232 on November 27, 2023, 12:31:10 AM
Quote from: CJ on November 26, 2023, 06:08:52 PM
You can try doing a packet capture but you're probably better off just restarting from scratch with a dynamic domain as that's where you want to eventually end up.

I tried doing this a while back. I am on vacation now so don't have screenshots. But essentially from what I remember is the packet was sent but never received from the server. I can retest this later though. I would like to restart with a dynamic dns but the problem is regardless of what I do now, I can't connect to the WireGuard server on that router. I deleted all my firewall rules and retried but I'm getting the same results.
Title: Re: Wireguard plugin not connecting after IP change
Post by: CJ on November 27, 2023, 04:13:20 PM
Quote from: meyergru on November 26, 2023, 08:03:36 PM
Plus, you have to consider that "far" side of the wireguard tunnel does not try to use the updated DNS entry, it just keeps trying the old IP unless you use the provided check/restart cron job there.

Won't it eventually fail out and restart?  I haven't really noticed an issue with mine but it doesn't tend to change often.

Quote from: bigr4232 on November 27, 2023, 12:31:10 AM
I tried doing this a while back. I am on vacation now so don't have screenshots. But essentially from what I remember is the packet was sent but never received from the server. I can retest this later though. I would like to restart with a dynamic dns but the problem is regardless of what I do now, I can't connect to the WireGuard server on that router. I deleted all my firewall rules and retried but I'm getting the same results.

Try uninstalling the plugin, rebooting, and installing it again.
Title: Re: Wireguard plugin not connecting after IP change
Post by: bigr4232 on December 04, 2023, 08:06:20 AM
Gave that a try and then tried redoing all my settings for wireguard. Still having the same issue. I uninstalled it by removing it in the plugins page. Not sure if there is a different way to uninstall it though.