Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PersistentKeepalive Client #990

Closed
5J2J opened this issue Mar 20, 2020 · 4 comments
Closed

PersistentKeepalive Client #990

5J2J opened this issue Mar 20, 2020 · 4 comments

Comments

@5J2J
Copy link

5J2J commented Mar 20, 2020

Is your feature request related to a problem? Please describe.
A PersistentKeepalive should be added automatically when creating a client, I use PersistentKeepalive 1

Describe the solution you'd like
Add PersistentKeepalive to the script

@orazioedoardo
Copy link
Member

What would be the benefit?

@orazioedoardo
Copy link
Member

No comments in a while, closing...

franklouwers added a commit to franklouwers/pivpn that referenced this issue Nov 10, 2020
Add PersistentKeepalive parameter to client config, closes pivpn#990
@franklouwers
Copy link

Would suggest to reopen this: I have the same issue.

As to your question: adding this keeps the connection alive through most NAT setups. WG will only use the tunnel when a packet needs to be sent. Most (all) NAT gateways / firewalls / routers, will see that no traffic happens for a while, and will wipe the NAT entry. If the client (behind NAT) needs to connect to the server, that's fine: the client initiates a new connection, this is picked up by the NAT gw, etc. But if the connection has expired and the server needs to connect to the client, it can't.

Adding "PersistentKeepalive = 25" will send a keep-alive packet from the client to the server every 25 seconds, thus forcing the NAT gateway to keep everything in place, allowing the server to connect to the client if needed.

More info: https://www.wireguard.com/quickstart/#nat-and-firewall-traversal-persistence

Patch: #1174

@DerDanilo
Copy link
Contributor

FYI: Added to wireguard profiles
88a701c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants