Yunbao VPN

Linux VPN startup and network dependencies

Does a Linux VPN service start before networking is ready? Check network-online dependencies

A VPN service that briefly fails at boot but works after a manual restart may have a network-ordering issue, though DNS, routing, or the service itself could also be responsible. systemd `network.target` does not mean usable connectivity is ready. Check the network manager, wait-online service, and actual unit dependencies before changing ordering.

Content updated:

Determine whether the failure is limited to boot

  1. Compare the VPN unit’s current-boot log with the active network manager’s logs, such as NetworkManager or systemd-networkd.
  2. Record when the service failed, the default route appeared, DNS became usable, and the listener opened. Use journal timestamps instead of relying on “it worked later.”
  3. If the service also disconnects during normal operation, investigate the VPN process, upstream gateway, and DNS rather than attributing every fault to boot ordering.

Check the targets and matching wait-online implementation

Use `systemctl show your-vpn.service -p Wants -p After` to inspect dependencies, then check `systemctl list-dependencies network-online.target` and the status of `NetworkManager-wait-online.service` and `systemd-networkd-wait-online.service` to identify the implementation actually in use. systemd documents `network-online.target` for units that strictly need configured networking and leaves the precise readiness condition to the network manager. Do not assume both wait-online services should be enabled.

Consider the cost of waiting before changing ordering

Adding a dependency on `network-online.target` makes the service wait for the network manager to report readiness; a misconfigured wait service can also slow or stall boot. If ordering is confirmed as the cause, have an administrator adjust the wait-online configuration and unit dependencies for the actual distribution and network stack, with a reasonable timeout. Afterward, verify the full boot log, DNS resolution, and external route—not just whether the target became active.

References and further reading

Back to all guides

Ready to connect?

Get the app from the official website and follow the instructions for your device.

Download ↓