Router restart ends up with wireguard connection issue

Router restart ends up with wireguard connection issue

Router restart ends up with wireguard connection issue
Router restart ends up with wireguard connection issue
2024-11-25 17:25:07 - last edited 2025-05-12 02:27:01
Model: ER605 (TL-R605)  
Hardware Version: V2
Firmware Version: 2.2.6

Introduction

I have multiple ER605 running. All of them are connected to a wireguard vpn server, which is hosted on an ubuntu server in the cloud. The ER605 are all behind a CG-NAT and so they are actively connecting to the cloud server.

 

Setup

Site A holds the controller and connects to a wireguard server in the cloud

Site B connects to the wireguard server in the cloud

Site B uses the controller at Site A

 

Problem

If the ER605 restarts, for example because of losing power or someone at the site think it is a good idea to reset the router, it connects to whatever WAN setup is made. From PPPoE over DHCP, everything is working. The only thing, which is not connecting is the wireguard connection. The router does not connect until I turn off and on the wireguard setup on the ER605 at the specific site OR (and this is really interesting) I restart the wireguard service on the wireguard server in the cloud.

I except that the ER605 connects to the wireguard server after the restart and I don't want to disable and enable the service on the ER605 and I also don't want to restart the wireguard service on the server.

In this specific setup I only can restart the wireguard service at the wireguard server, because the ER605 needs the connection to get updates from the controller.

There is also a non ER605 router in this setup and this device (pfSense) connects to the wireguard server after a restart. Only the ER605 router does not connect after a restart.

 

Question

Is anyone having the same problem, that the wireguard service from the ER605 does not connect automatically after reboot?

 

greets, Odin

...
  0      
  0      
#1
Options
1 Accepted Solution
Re:Router restart ends up with wireguard connection issue-Solution
2025-05-09 20:05:08 - last edited 2025-05-12 02:27:01

  @chattin 

Yes, but it is more a workaround. I monitored the wireguard connection and if the connection has been lost for about 5 minutes, i restart the wireguard connection on the server side with just systemctl restart wg-quick@your-wg and the connection goes up. If you don't want to have this automatically, you can do this by hand. Just bring this connection up again.

 

The next thing is TP-Link resolved this issue a few months ago. Sorry for not replying.

 

(Because of some changes on my side, I have to change my username - @Odin_ygg is the old one)

greets from austria, olli

Recommended Solution
  0  
  0  
#5
Options
10 Reply
Re:Router restart ends up with wireguard connection issue
2024-11-26 00:30:48 - last edited 2024-11-28 00:26:09

Hi @Odin_ygg 

Thanks for posting in our business forum.

See the solution page:

Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced. ● I don't provide ETA for any products/features. No comment.
  1  
  1  
#2
Options
Re:Router restart ends up with wireguard connection issue
2024-11-27 18:32:08

  @Clive_A 

 

thanks for your fast reply, but the solution you recommended does not fit my scenario. The problem here is not that the router is restarting. The problem is that the router does not connect to the wireguard server as long as the service has not been resetted. Just the service has to be resetted, every other thing is doing well.

I will give it a try with some packet trace and I hope to see the problem.

...
  1  
  1  
#3
Options
Re:Router restart ends up with wireguard connection issue
2025-05-09 19:46:26

  @Odin_ygg Did you ever find a solution for this? I'm having the same problem with the TL-WR1502X.

  0  
  0  
#4
Options
Re:Router restart ends up with wireguard connection issue-Solution
2025-05-09 20:05:08 - last edited 2025-05-12 02:27:01

  @chattin 

Yes, but it is more a workaround. I monitored the wireguard connection and if the connection has been lost for about 5 minutes, i restart the wireguard connection on the server side with just systemctl restart wg-quick@your-wg and the connection goes up. If you don't want to have this automatically, you can do this by hand. Just bring this connection up again.

 

The next thing is TP-Link resolved this issue a few months ago. Sorry for not replying.

 

(Because of some changes on my side, I have to change my username - @Odin_ygg is the old one)

greets from austria, olli

Recommended Solution
  0  
  0  
#5
Options
Re:Router restart ends up with wireguard connection issue
2025-05-12 02:24:48

  @chattin

chattin wrote

  @Odin_ygg Did you ever find a solution for this? I'm having the same problem with the TL-WR1502X.

His question deviated from the original topic. In the previous reply, there was an issue where the WG would crash the system due to the config.

 

If it is the problem "not able to connect", then you have to troubleshoot to ensure you have the proper settings.

Wireguard is not gonna be easy for a starter who has not used a VPN previously.

 

Most, I'd say 70%, VPN issues are not a problem with the VPN function, but the config.
Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced. ● I don't provide ETA for any products/features. No comment.
  1  
  1  
#6
Options
Re:Router restart ends up with wireguard connection issue
2025-05-12 16:58:41

  @Clive_A 

I think the problem comes down to DNS not being ready before Wireguard attempts to connect.

Instead of using a url as my endpoint address, I tried with the IP that the url resolves to - it works, and automatically reconnects after reboot. 

The URL will work, but only if triggered/toggled manually after boot. 

I've manually set the DNS to 8.8.8.8/1.1.1.1, but the issue persists, so I'm guessing that the Wireguard service just initializes before DNS. 

 

Thoughts? Any way to fix? Thanks.

  0  
  0  
#7
Options
Re:Router restart ends up with wireguard connection issue
2025-05-13 00:49:56

  @chattin 

chattin wrote

  @Clive_A 

I think the problem comes down to DNS not being ready before Wireguard attempts to connect.

Instead of using a url as my endpoint address, I tried with the IP that the url resolves to - it works, and automatically reconnects after reboot. 

The URL will work, but only if triggered/toggled manually after boot. 

I've manually set the DNS to 8.8.8.8/1.1.1.1, but the issue persists, so I'm guessing that the Wireguard service just initializes before DNS. 

 

Thoughts? Any way to fix? Thanks.

I don't think Wireguard or OVPN can resolve the FQDN. That is a request that is known.

Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced. ● I don't provide ETA for any products/features. No comment.
  1  
  1  
#8
Options
Re:Router restart ends up with wireguard connection issue
2025-05-13 13:14:11

  @Clive_A 

 

See that's the thing - it does work with FQDN when the VPN is toggled on manually, it just doesn't reconnect automatically after reboot. 

 

I've opted to go a different direction, so this is no longer an issue for me, but hopefully this is something that can resolved regardless for other users.

  1  
  1  
#9
Options
Re:Router restart ends up with wireguard connection issue
2025-05-14 03:07:51 - last edited 2025-05-14 03:17:07

  @chattin 

chattin wrote

  @Clive_A 

 

See that's the thing - it does work with FQDN when the VPN is toggled on manually, it just doesn't reconnect automatically after reboot. 

 

I've opted to go a different direction, so this is no longer an issue for me, but hopefully this is something that can resolved regardless for other users.

It worked, which could be because the FQDN is resolved and cached.

I assume the solution for this issue is that the FQDN after the reboot should be resolved by the DNS, instead of by the cache. 

The FQDN feature is pending being added(FQDN for OVPN and WG available in the new adaptation from the Pre-Release).

Best Regards! If you are new to the forum, please read: Howto - A Guide to Use Forum Effectively. Read Before You Post. Look for a model? Search your model NOW Official and Beta firmware. NEW features! Subscribe for the latest update!Download Beta Here☚ ☛ ★ Configuration Guide ★ ☚ ☛ ★ Knowledge Base ★ ☚ ☛ ★ Troubleshooting ★ ☚ ● Be kind and nice. ● Stay on the topic. ● Post details. ● Search first. ● Please don't take it for granted. ● No email confidentiality should be violated. ● S/N, MAC, and your true public IP should be mosaiced. ● I don't provide ETA for any products/features. No comment.
  1  
  1  
#10
Options
Re:Router restart ends up with wireguard connection issue
2025-05-29 21:41:55

  @Clive_A 

Good evening @Clive_A 

I am running two ER706W v1.20 and they have actually the same problem the ER605 does have a few months ago. If one of the routers restarts, they don't bring up the Wireguard connection until I restart the wg interface on the Wireguard server. I have not used FQDN, just a static IP address.

I think the problem got solved with some firmware at the ER605 but the ER706W has this issue at the moment.

 

Maybe you can give some bug report to the development team?

  0  
  0  
#11
Options