WireGuard 连接在睡眠后不恢复

问题描述 投票:0回答:0

系统停止(可能在最新的内核升级之后)从睡眠周期恢复。在恢复互联网工作后,它可以在没有 Wireguard 的情况下工作(来自 ISP 的 IP)。我向前升级了内核,但问题仍然存在。降级尚未测试。

现在每次简历后我都必须

systemctl restart [email protected] 


journalctl -u systemd-networkd.service
journalctl -u [email protected] 

没有显示任何错误。

resume之后我也觉得没什么特别的

Feb 28 21:11:30 book wg-quick[2693]: [#] ip -6 route add ::/0 dev profile table 51820
Feb 28 21:11:30 book wg-quick[2693]: [#] ip -6 rule add not fwmark 51820 table 51820
Feb 28 21:11:30 book wg-quick[2693]: [#] ip -6 rule add table main suppress_prefixlength 0
Feb 28 21:11:30 book wg-quick[2726]: [#] ip6tables-restore -n
Feb 28 21:11:30 book wg-quick[2693]: [#] ip -4 route add 0.0.0.0/0 dev profile table 51820
Feb 28 21:11:30 book wg-quick[2693]: [#] ip -4 rule add not fwmark 51820 table 51820
Feb 28 21:11:30 book wg-quick[2693]: [#] ip -4 rule add table main suppress_prefixlength 0
Feb 28 21:11:30 book wg-quick[2693]: [#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
Feb 28 21:11:30 book wg-quick[2736]: [#] iptables-restore -n
Feb 28 21:11:30 book systemd[1]: Finished WireGuard via wg-quick(8) for profile.

Attempted to add universal script which would restart all wireguard profiles that run before suspend.

case "$1" in
    post)
        /usr/bin/systemctl restart wg-quick.target
        ;;
esac

/usr/lib/systemd/system-sleep

但这结果是

March 01 02:59:43 book systemd[1]: Stopped WireGuard via wg-quick(8) for profile.
March 01 02:59:43 book systemd[1]: Starting WireGuard via wg-quick(8) for profile...
March 01 02:59:43 book wg-quick[19207]: wg-quick: `profile' already exists
March 01 02:59:43 book systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
March 01 02:59:43 book systemd[1]: [email protected]: Failed with result 'exit-code'.
March 01 02:59:43 book systemd[1]: Failed to start WireGuard via wg-quick(8) for profile.

之后

# systemctl restart [email protected]
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xeu [email protected]" for details.
# systemctl stop [email protected]
# systemctl start [email protected]
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xeu [email protected]" for details.

Linux book 6.1.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 14 Feb 2023 22:08:08 +0000 x86_64 GNU/Linux
升级为
Linux book 6.2.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 26 Feb 2023 03:39:23 +0000 x86_64 GNU/Linux 
所有 systemd

systemd wireguard
© www.soinside.com 2019 - 2024. All rights reserved.