If you’re using a Mac, there’s a good chance you’re connected to some sort of VPN. Whether it’s a free service like OpenVPN or a more expensive one like ExpressVPN, connecting to a VPN is an essential part of keeping your data safe and secure. But how do you connect your Mac to the VPN? And if you ever need to reconnect, how do you do it automatically? Here’s how:

  1. Open the System Preferences app and click on the Connections tab.
  2. In the list of connections, select your VPN connection and click on Reconnect.
  3. The system will automatically reconnect to your VPN and start working again as if nothing happened.

This process is similar whether you’re using Windows, Android, iPhone, iPad, or another operating system. macOS provides a menu bar icon for controlling the VPN connection.

RELATED: What Is a VPN, and Why Would I Need One?

Use a VPN Client (The Easiest Thing)

Note that some VPN providers offer their own desktop clients, which means you won’t need this setup process. All of the best VPNs—StrongVPN for advanced users, and ExpressVPN and TunnelBear for basic users—offer their own desktop application for connecting to their VPNs and selecting VPN server locations.

Connect to L2TP over IPSec, PPTP, and Cisco IPSec VPNs

Use the Network control panel to connect to most types of VPNs. To open it, click the Apple icon in the top-left corner of the menu, select “System Preferences,” and choose “Network” or click the Wi-Fi icon on the menu bar and select “Network Preferences.”

Click the “+” button in the bottom-left corner of the window and select “VPN” in the Interface box. Choose the type of VPN server you need to connect to in the “VPN Type” box and enter a name that will help you identify it.

Like other operating systems, macOS doesn’t include built-in support for OpenVPN networks. Scroll down for instructions for connecting to OpenVPN networks.

Enter the VPN server’s address, your username, and other settings. The “Authentication Settings” button allows you to provide the authentication you’ll need to connect—anything from a password or certificate file to RSA SecurID, Kerberos, or CryptoCard authentication.

The “Advanced” button allows you to configure the VPN connection in other ways. For example, the default settings automatically disconnect from the VPN when you log out or switch users. You could uncheck these boxes to prevent the Mac from automatically disconnecting.

Click “Apply” to save your settings. Before you do, you can enable the “Show VPN status in menu bar” option to get a menu bar icon for managing your VPN connection. Use this menu to connect to your VPN and disconnect from it as necessary.

Automatically Reconnect to a VPN When the Connection Drops

By default, your Mac won’t automatically reconnect to the VPN if the connection dies. To save yourself some time and hassle, use the VPN AutoConnect application. It’s available for $1 on the Mac App Store.

This is a simple application that basically replaces the built-in VPN menu bar icon on Mac. If the VPN connection drops, it will automatically reconnect. This application uses the built-in VPN support in macOS, so it’ll only work with connections you can configure in the Network Settings panel. If you use a third-party VPN client — for example, to connect to an OpenVPN VPN — it won’t help you. But third-party VPN clients may have this feature integrated.

If you want to save a dollar or just prefer DIY solutions, you could rig up your own auto-VPN-reconnect solution using AppleScript.

Connect to OpenVPN Networks

You’ll need a third-party application for connecting to OpenVPN VPNs. The official OpenVPN website recommends the open-source Tunnelblick application for this.

Install Tunnelblick, launch it, and it will ask for the configuration files provided by your OpenVPN server. These often have the .ovpn file extension and are required for connecting from any OpenVPN client. Your OpenVPN server provider should provide them to you.

Tunnelblick provides its own menu bar icon for managing your OpenVPN connections. Select “VPN Details” and you’ll see Tunnelblick’s connection window, where you can configure how it works.

For example, you can have Tunnelblick automatically connect to OpenVPN networks when this application launches. It can automatically keep you connected to the VPN network, so you won’t need a tool like VPN AutoConnect.

If you need to connect to another type of VPN network, you’ll need a different third-party VPN client with support for that type of network.

RELATED: How to Choose the Best VPN Service for Your Needs