Jump to content
Not connected, Your IP: 216.73.217.99
displaynamethrowaway

NetworkManager Wireguard connection breaks after restart on Linux

Recommended Posts

Hello,
I have a computer running Fedora 39 Server Edition and I would like it to have it always be connected to AirVPN. I downloaded a Wireguard conf file from the generator and moved it to /etc/wireguard/wg0.conf . Then I ran "sudo nmcli connection import type wireguard file /etc/wireguard/wg0.conf". Initially, this works. I can connect and traffic is routed throuh the VPN connection. However, when I restart the machine, the connection breaks and I cannot connect to anything through it ("ping google.com" fails). However, I can run "sudo nmcli up wg0" it works again. It is set up to connect automatically. Here is some relevant output from "nmcli con show wg0".

connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
Please let me know what other information would be helpful for troubleshooting. How can I get the connection to come up on its own without my intervention?
Thank you.

Share this post


Link to post

Add Wireguard as a service using systemd which will connect on startup.

sudo systemctl enable wg-quick@wg0.service
sudo systemctl daemon-reload

Start the service manually:
sudo systemctl start wg-quick@wg0

Reboot and check if Wireguard has started and connected automatically.
 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...