Jump to content
Not connected, Your IP: 3.136.18.192
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...