Skip to content

How Do You Check Whether a Linux VPN Service Starts at Boot?

A VPN service that is enabled is not the same as a tunnel that is up and carrying traffic after a restart. Here is how to check each step on Linux.

10 min readUpdated Nov 11, 2026By XPASS Editorial Team

How Do You Check Whether a Linux VPN Service Starts at Boot?

Many people set up a VPN on Linux once and assume it will be there after every restart. Sometimes it is. Sometimes the laptop boots, the desktop loads, a browser opens and a few synchronisation tools connect, all before the tunnel exists, and nobody notices because everything still seems to work. The check you want is not "did I enable something once" but "after a cold start, was the tunnel up before my programs needed it, and is traffic actually using it".

This article is about verification, not setup. It shows how to find the right service name, read its state, test it with a real reboot and confirm the result from the network side. If you still need to install and sign in, start with the Linux setup guide. If you want to write the unit file itself, the article on running WireGuard under systemd covers that; here we only check what is already there.

What "starts at boot" can mean

On a modern Linux desktop, a VPN can be brought up in at least four different ways, and each one is checked differently. Before you run any command, work out which one applies to you.

How the VPN starts Who starts it Where to look
A systemd unit such as wg-quick@wg0 or openvpn-client@name systemd, at boot, before you log in systemctl, journalctl
A NetworkManager connection with "connect automatically" NetworkManager, once its own networking is up nmcli, journalctl -u NetworkManager
A desktop app that starts with your session The desktop environment, after you log in The app's own settings, autostart entries, app logs
A script or cron @reboot entry you wrote yourself cron or a login script The script, the cron table, the system log

The important difference is timing. A system-level service can start before anyone logs in. A desktop app or a user-level entry starts only after you have signed in to the desktop. Neither is wrong, but they give different answers to "is the VPN up while the machine is booting", and you should know which one you have.

If you use the free VPNclient app from our supplier on Linux, treat its start-up behaviour as something to confirm on your own machine. The Linux build is for 64-bit Intel/AMD desktops with systemd, but the exact autostart behaviour is not something this article can promise. Look in the app's settings, check your desktop's startup applications list, and use the reboot test below to see what really happens.

Step 1: find the service name

You cannot check a service you cannot name. List the unit files that look VPN-related.

systemctl list-unit-files --type=service | grep -i -E "vpn|wg-quick|openvpn|wireguard"

You may see names such as wg-quick@wg0.service, openvpn-client@work.service or a vendor-specific unit. The part after the @ is the instance, usually the name of the configuration file. The third column of the output is the state: enabled, disabled, static, masked or similar.

If nothing matches, that is itself a useful answer. It means no system-level VPN unit is installed, and the VPN is probably started in another way from the table above. Check NetworkManager next:

nmcli connection show

Look for a connection of type vpn or wireguard and then ask whether it connects automatically:

nmcli -f connection.id,connection.autoconnect connection show "your-connection-name"

A value of yes means NetworkManager will try to bring it up. The article on adding a VPN profile in NetworkManager goes deeper on that route.

Step 2: read the enabled and active state

Two different questions are hiding in the word "running". One is whether systemd will start the unit at boot. The other is whether it is running right now. Ask both.

systemctl is-enabled wg-quick@wg0
systemctl is-active wg-quick@wg0

Replace the name with your own. Here is how to read the answers.

is-enabled is-active Meaning
enabled active Will start at boot and is up now. This is the state you want, but it is not yet proof.
enabled inactive or failed Will try at boot, but is not up. Read the log before rebooting.
disabled active Running only because you started it by hand. It will not return after a reboot.
disabled inactive Not configured to start at all.
masked any Deliberately blocked. It will not start even if you ask.

The middle row is the one that surprises people. A unit can be enabled, try to start at every boot and fail every time, because of a typo in the configuration, a missing key file or a network that was not ready. You only see this if you look at the state after a boot, not just after you enabled it.

For a fuller picture, run:

systemctl status wg-quick@wg0

The output shows when the unit last started, whether it exited cleanly and the last few log lines. For tunnel units that only run a command and exit, systemd may show active (exited). That is normal for a unit that configures an interface and then has nothing left to supervise. It does not mean the tunnel dropped.

Step 3: read the log for the current boot

The log answers the question the status line cannot: what happened at start-up, and in what order. Limit it to the current boot so older attempts do not confuse you.

journalctl -b -u wg-quick@wg0 --no-pager

Look for three things.

  1. A start time. Compare it with the time the network came up. You can see that with journalctl -b -u NetworkManager or journalctl -b -u systemd-networkd.
  2. An error line. Typical causes are a missing configuration file, a wrong path, a name that cannot be resolved because DNS was not ready yet, or a permission problem on a key file.
  3. A retry or a timeout. A line saying the unit failed with a result such as timeout or exit-code often means the network was not ready when it ran.

If the unit started before the network was ready and the server address in its configuration is a host name, the lookup can fail simply because DNS was not available yet. This is a name-resolution timing problem rather than a broken server. The fix is usually ordering, not a different server: make the unit wait for the network to be online, which is covered in the systemd article linked above.

You can also see the whole start-up order with:

systemd-analyze critical-chain wg-quick@wg0.service

This prints the chain of units that had to finish before yours and the time each took. It shows plainly whether your VPN unit waited for the network or ran ahead of it.

Step 4: confirm the tunnel exists and is used

A unit that started and exited cleanly has still only proved that a command ran. Confirm the network side with three quick checks.

First, does a tunnel interface exist?

ip link show

Look for an interface such as wg0, tun0 or tap0. If it is not there, the tunnel is not up regardless of what the service says.

Second, where does the default route point?

ip route
ip -6 route

For a full tunnel, the default route, or the two half-routes that replace it, should point at the tunnel interface. If your default route still points at your Wi-Fi or Ethernet interface, programs are going out the normal way. Some setups intentionally route only part of the traffic through the VPN. If that is your design, check that the specific networks you care about use the tunnel.

Third, what does the outside world see?

curl -s https://ifconfig.me

Compare the result with your normal address when the VPN is off. If they are the same, the VPN is not carrying that traffic. This is also a good moment to run a DNS check, because a tunnel can be up while name lookups still go to the local network. Test DNS properly rather than relying on one command.

Step 5: do a real reboot test

Everything above can look right and still fail on a cold start, because many problems depend on timing, power state or the order of services. Only a real reboot tests the real path.

A clean procedure:

  1. Write down what you expect. For example: "wg0 exists, default route via wg0, public IP is the VPN address, within one minute of boot."
  2. Turn the VPN off and make sure the unit is in the state you intend to test. If you are testing boot behaviour, stop it with systemctl stop and confirm it is down.
  3. Reboot with sudo systemctl reboot. Do not suspend and resume; that tests a different path.
  4. After you log in, run the same four commands from the earlier steps: systemctl is-active, journalctl -b, ip link and the public IP check.
  5. Note the result, change one thing if needed, and reboot again.

Do this at least twice. A VPN that comes up on the first reboot and fails on the second is more common than you would expect, because first and later boots can differ in what is cached or what finished first.

Also test the two situations that real life brings. One is booting while connected to Ethernet, then Wi-Fi only. The other is booting with no network at all and connecting later, such as a laptop opened on a train. A service that was designed for a wired desktop may behave very differently when the network appears 40 seconds after the unit has already given up.

Plain example: a laptop that "worked" but leaked

Imagine a Linux laptop with wg-quick@wg0 enabled. The owner enables it, tests it, sees the tunnel and is happy. Weeks later, a quick look at the boot log shows the unit starts about eight seconds after the cloud-sync tool, which connects as soon as the desktop loads. For those eight seconds, the sync tool talks over the normal network. Nothing visibly broke, and no error was shown.

Nothing is wrong with the VPN here. The issue is ordering. The owner has two honest options. Either make the sync tool start after the VPN is up, using a systemd dependency or a delayed autostart, or add a firewall rule that blocks traffic outside the tunnel so early connections simply wait. The article on a Linux VPN kill switch shows how to build that rule and how to test it without locking yourself out. This example is invented to show the pattern, not to describe any specific product's behaviour.

Common reasons a service does not start at boot

When the reboot test fails, the cause is usually one of a short list.

  • Not enabled. You started it with start but never ran enable. The state shows disabled and active.
  • Wrong instance name. The unit name must match the configuration file name. A file called office.conf needs @office, not @wg0.
  • Network not ready. The unit ran before the interface had an address, or before DNS worked.
  • Credentials unavailable. Some clients read a password from the desktop keyring or a file in your home directory. Neither is available until you log in, so a system-level unit cannot use it.
  • Permission or path problems. A key file with the wrong owner or mode, a configuration in the wrong folder, or an SELinux or AppArmor denial in the log.
  • Another manager competing. NetworkManager and a systemd unit both try to manage the same interface, and one tears down the other.
  • IPv6 left outside. The tunnel is up for IPv4 but IPv6 traffic still goes the normal way. Check ip -6 route as well.
  • A stale firewall rule. A kill switch rule from an older setup blocks the unit's own handshake, so the tunnel never completes.

Fix one at a time and reboot after each change. Changing three things at once leaves you guessing which one mattered.

Limits and what to watch for

A boot check is useful, but it has honest limits.

  • Enabled is a promise, not a result. Only a log from the current boot and a network check show what happened.
  • A running service is not a private connection. It can be up while some traffic, especially IPv6 or DNS, takes another route. A VPN also does not make you anonymous or guarantee security; it changes the path of your traffic between you and the VPN server.
  • Desktop apps follow your session. If the VPN is a desktop app, it cannot be up before you log in unless the app provides a system service for that. Do not assume it does; verify.
  • Distributions differ. Unit names, the default network manager and the location of configuration files vary between distributions and versions. Treat the commands above as a pattern and adapt the names.
  • Supported hardware matters. The VPNclient Linux build targets 64-bit Intel/AMD desktops with systemd. It is not available for ARM, so a Raspberry Pi-style board needs a different approach.
  • Remote machines are risky. If you test boot behaviour or firewall rules on a server you reach over SSH, a mistake can lock you out. Keep console access or a timed rollback.

If a check shows something you cannot explain after two clean reboots, collect the output of systemctl status, journalctl -b -u for the unit and ip route before asking for help. With those three, a support agent or a forum can usually point to the cause quickly.

A short checklist you can reuse

Keep these lines somewhere you can paste them.

  1. systemctl list-unit-files | grep -i -E "vpn|wg-quick|openvpn" to find the name.
  2. systemctl is-enabled NAME and systemctl is-active NAME for the two states.
  3. journalctl -b -u NAME --no-pager for what happened this boot.
  4. systemd-analyze critical-chain NAME.service for ordering against the network.
  5. ip link, ip route, ip -6 route for the tunnel and routes.
  6. curl -s https://ifconfig.me with the VPN on and off to compare.
  7. A full reboot, twice, then repeat steps 2 to 6.

Summary

To check whether a Linux VPN service starts at boot, first work out how your VPN is started, then read its enabled and active state, read the log for the current boot, confirm that a tunnel interface and routes exist and finally prove it with a real reboot, twice. An enabled unit is only a promise; the log and the network checks tell you whether the promise was kept and whether your programs waited for it. If you want a VPN pass to test this on your own machine, you can look at the XPASS pass options, and the help centre has setup guides for each device.

Frequently asked questions

How do I see whether a VPN service is enabled at boot on Linux?

Run systemctl is-enabled with the unit name. The answer enabled means systemd will start it at boot, disabled means it will not. You can list candidates with systemctl list-unit-files and a filter such as vpn, wg-quick or openvpn.

The service says enabled but my VPN is not connected after a reboot. Why?

Enabled only means systemd is allowed to start the unit. The unit may have started before the network was ready, failed on a missing credential, or exited because the desktop keyring was still locked. Read the log for the current boot with journalctl -b -u and the unit name.

Does the XPASS app start automatically at boot on Linux?

This article does not assume it does. Whether the VPNclient desktop app on Linux starts with your session depends on the app and your desktop settings, so check the app's own options and test with a reboot instead of relying on a guess.

How can I tell if traffic really goes through the VPN after boot?

Check that a tunnel interface exists with ip link, that the default route points at it with ip route, and then compare your public IP address with and without the VPN. A running service alone does not prove traffic is using it.

Is it safe to leave apps running before the VPN is up?

Not if privacy matters to you. During boot, programs may connect over the normal network before the tunnel exists. A firewall rule that blocks traffic outside the tunnel, or starting those programs only after the VPN is up, closes that gap.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Need a VPN for a short trip or a busy month?

XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.

See passes

Keep reading

Device Guides

Manage WireGuard with systemd on Linux

Turn a hand-started WireGuard tunnel into a proper service. Learn wg-quick units, boot ordering, drop-in overrides, safe reloads, a health-check timer and the native systemd-networkd alternative.

10 min read

Device Guides

How to Configure a Linux VPN Kill Switch

On Linux a kill switch is a firewall rule, not a button. Three ways to build one, what traffic must still be allowed, and a safe test routine.

10 min read

Device Guides

How to Add a VPN in Linux NetworkManager

How NetworkManager stores VPN profiles, how to add one in GNOME, KDE or nmcli, and which settings (routes, DNS, auto-connect, secrets) decide whether it behaves well.

10 min read