15
如何让 wireguard 自动重新连接
source link: https://www.v2ex.com/t/863087
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
由于家里宽带的 ip 经常变动所以我 endpoint 写的是域名,这就导致了 Windows 和 Android 的客户端连接时间长了就连不上了,他们又不会自动重新链接,需要手动断开一次,很麻烦。
iOS 上我用的 surge 作为客户端就没问题,请问有没有什么办法可以解决?
9 条回复 • 2022-06-30 10:00:05 +08:00
XiLingHost 1 小时 11 分钟前 Windows 上我是靠计划任务实现的
写一个 ps1 脚本 ```powershell $profileName = "" $servicesName = "WireGuardTunnel`$$profileName" $log = wireguard.exe /dumplog | Select-String -Pattern $profileName | Select-Object -Last 10 | Select-String -Pattern retrying if ($log.Length -gt 3) { Write-Output $log Stop-Service $servicesName Start-Sleep -Seconds 5 Start-Service $servicesName } ``` 然后让它 5 分钟跑一次 |
0o0O0o0O0o 1 小时 9 分钟前 via iPhone Linux 上配置 PersistentKeepalive 是可以自动重连的
|
DrX 1 小时 4 分钟前 @0o0O0o0O0o 我发现 PersistentKeepalive 无效,我最终的方法是弄个 cronjob 每隔几分钟 ping 一次服务器。
|
0o0O0o0O0o 1 小时 2 分钟前 via iPhone |
madao2015 56 分钟前 只能检测 ddns 变化然后定时重启了
|
Awes0me 28 分钟前 |
bjfane 19 分钟前 PersistentKeepalive 好使 也没断过,想用就用,但是没发现 ip 变化,ip 变化帝都好像是大概两周 1 次,还好,也配置了 ddns ,
|
zhixiao 18 分钟前 我这 ip 已经快 1 个月没变了。。。其实 ip 变化的也不频繁,断了手动连一下就是了
|
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK