VPN disconnects when the Mac sleeps

When the Mac sleeps, its network connection goes down, and most VPN tunnels go down with it. The VPN must then connect again after wake. This guide finds when the drops happen and which setting reconnects the VPN.

Fix this with your agentCopies a prompt for Claude Code, Codex or any agent that can use Terminal.

My Mac has this problem: VPN disconnects when the Mac sleeps. Read https://kilobat.app/guides/vpn-disconnects-after-sleep.md and work through it with me. Install the Kilobat CLI if it’s missing: brew install seifip/kilobat/kilobat. Run the guide’s Terminal and kilobat checks yourself and tell me what you find. List the steps only I can do. Ask before you change any setting.

Applies to: All current macOS versions. Settings in VPN apps depend on the vendor.Checked: 7 November 2026

Symptoms

  • After you open the lid, the VPN shows as disconnected.
  • The VPN stays connected in its app, but no traffic passes after wake.
  • A download or SSH session over the VPN stops each time the Mac sleeps.
  • Internal sites fail for a minute after wake, then work again.

Likely causes

  • The network link goes down during sleep. The tunnel depends on the Wi-Fi or Ethernet connection. When the Mac joins the network again, the VPN must connect again.
  • The VPN has no automatic reconnect. VPN On Demand and the reconnect options in VPN apps start the tunnel again. Without them, you connect by hand.
  • VPN On Demand cannot ask for your password. Apple says that VPN On Demand needs authentication without user interaction, such as a certificate.
  • Wi-Fi joins slowly after wake. The VPN cannot connect until the Mac has a working network. See Mac Wi-Fi disconnects after sleep.
  • The server ends idle or old sessions. Some VPN servers close a session that was quiet for a long time. Ask your administrator about the timeout.

How to check

  1. Show the most recent sleep and wake events with their times.

    pmset -g log | grep -E ' (Sleep|Wake|DarkWake) ' | tail -20
  2. After the next wake, show the state of each VPN configuration.

    scutil --nc list
  3. Show the network state. Make sure that Wi-Fi or Ethernet is reachable before the VPN tries to connect.

    scutil --nwi
  4. Compare the wake times with the times when the VPN dropped.

How to fix it

  1. In the VPN app, turn on its auto-connect or reconnect option. The name differs between vendors.

  2. Update the VPN app to its latest version.

  3. For a managed VPN, ask your administrator to turn on VPN On Demand in the profile.

  4. VPN On Demand needs certificate or other non-interactive authentication. Ask for a certificate if you sign in with a password.

  5. To keep the Mac awake during a long transfer, prevent sleep while the transfer runs. See caffeinate on Mac: keep awake from Terminal.

  6. If Wi-Fi is slow to join after wake, fix that first. Then test the VPN again.

With Kilobat

  1. Show if a VPN carries traffic now, and whether all traffic or only some uses it.

    kilobat ip
  2. The Kilobat app’s History lists when a VPN went on or off. Compare it with the sleep times from pmset.

  3. Show drops and network changes that the app recorded.

    kilobat outages
  4. Keep the Mac awake while a command over the VPN runs, such as a copy.

    kilobat awake -- rsync -a server:/data ./data
  5. With Kilobat Pro, the VPN kill switch blocks new connections while the VPN is down. Apps then do not open new connections on the open network before the VPN is back.

Questions

Does “Wake for network access” keep the VPN connected?

No. That setting lets the Mac wake for requests such as file sharing. It does not keep a VPN tunnel up. See Use Wake for network access on a Mac.

Does Always On VPN work on a Mac?

Apple’s VPN overview lists Always On VPN for iOS, iPadOS and visionOS. It does not list it for macOS.

Can a Mac keep the VPN up with the lid closed?

Only while the Mac stays awake. When it sleeps, the network goes down. See Keep a MacBook awake with the lid closed.

Sources

Checked on 7 November 2026.