I wireguard server and a single client have been setup on two VPSs to have a split tunnel in between, but every few hours, the client side connection stops and I have to restart the interface to reconnect again.
Both servers have public IP, there is no NAT or Firewalls.
server config
[Interface]
PrivateKey = ***
Address = 172.31.104.1/24
MTU = 1420
ListenPort = PORT
### begin c1 ###
[Peer]
PublicKey = ***
AllowedIPs = 172.31.104.2/32
PersistentKeepalive = 25
### end c1 ###
and the client
[Interface]
Address = 172.31.104.2/32
PrivateKey = ***
DNS = 1.1.1.2,1.0.0.2
[Peer]
PublicKey = ***
AllowedIPs = 172.31.104.1/24
Endpoint = IP:PORT
PersistentKeepalive = 25
even a cron job did not help (client side)
* * * * * /usr/bin/ping -c4 172.31.104.1
PersistentKeepalive
the thing is if I remove it , it stops working after few minutes, but when added lasts for hours, what else can cause this ?ip link; ip -br addr; ip route; ip rule
+nft list ruleset
(as root) + the output ofwg
(as root). You can replace public IP addresses with 1 or 2 blocks from RFC 5737: rfc-editor.org/rfc/rfc5737.html#section-3 . Then when it fails some minutes or hours later again the very same commands.