Procedure
If the computer automatically sleeps, the connection will be lost. In the macOS settings under Energy, do the following in order to keep the computer from “sleeping” and thus turning off the VPN:
- Select the Apple Logo at the top left, then click System Settings.

- Select Energy on the left column. Then toggle the switch on for "Prevent computer from sleeping automatically when the display is off".
