I get wireguard working from my ubuntu laptop to my linode running ubuntu, but after the first couple of connections it stops connecting. Even my ssh to the server stops working. I have to run wp-quick down on the client to restore my connections, however, without wireguard.
Here are my configs
Server
[Interface]
Address = 10.0.0.1/24
SaveConfig = true
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 51820
PrivateKey = <Private Key>
[Peer]
PublicKey = <Public Key>
AllowedIPs = 10.0.0.2/32
Endpoint = 98.122.111.39:51974
PersistentKeepAlive=30
Client
[Interface]
# IP Address and Private Key of the Client
Address = 10.0.0.2/24
PrivateKey = <private key>
[Peer]
# Public key, IP Address and Port of the Server
PublicKey = <public key>
Endpoint = 50.116.60.189:51820
AllowedIPs = 0.0.0.0/0
I thought adding PersistentKeepAlive would help, but it doesn't seem to do anything. Can anyone help me understand what is going wrong?